I want to upload Videos just like how you upload images.

I know how to use paperclip to upload images and have AWS S3 hold the images so heroku works, but I can't seem to make it work for videos. I know i'm suppose to user paperclip transcoder gem, but is an 'imagemagick' substitute that I have to use for videos? If so, do I need to install it on my computer like I did with IMagemagick?

Posted over 3 years ago by Masud Hossain
Posted over 3 years ago by Alex Yang

Is this the gem you're using? https://github.com/ruby-av/paperclip-av-transcoder

While I haven't used this gem before myself, it doesn't look like there are any additional dependencies you need to worry about.

1
Posted over 3 years ago by Masud Hossain

Yes, that's the gem I'm using.
I'm finding a lot of mixed replies. Some says it doesn't and some says it need FFMPEG.

1
Posted over 3 years ago by Masud Hossain

I'm building a website where Users can post videos they've made and make it viewable for other users only after they purchased it. I understand that I'll have to make a Has_many relationship, but what I don't understand is how to make the video viewable ONLY after another user buys it. Would this be an if statement in the view? Where the page will look completely different if user bought that video?

1
Posted over 3 years ago by Alex Yang

Yes, you would need to check whether the video has been purchased by the user (via an if statement in the view), and that would determine what to display on the page. Depending on how different those versions of the page are, it will probably be easiest to create partials for each version.

1
Posted about 3 years ago by Masud Hossain

I agree with the partial part, it'll make the If statement a lot easier as well.

I think I would have to use something like CanCan gem for the authorization, right?

I really appreciate your reply even though this question isn't regard to your courses. I'll repay back by telling my friends about your site :)

1
Posted about 3 years ago by Alex Yang

If your authorization rules are pretty complex, the CanCan gem will definitely help. However, if things are relatively straightforward, I would just use simple before_action statements at the top of your controller (this is the way we demonstrate in our courses).

1