Skip to main content

Usability And Video Autoplay With Wistia | GoRails - GoRails

General • Asked by Chris Oliver
Fritz Rodriguez Jr.

Hey Chris,

First and foremost! Thanks so much for all the excellent content you bring to the rails community!!! I'm very appreciative as a rails developer and have learned a greatly deal from your screencast!!

I'm including videos for the first time in my rails app and see that you use Wistia? I briefly check out their site, but was hoping you could shed some light as to why you use them?

Thanks and have a great say!

Great question Fritz and thanks for the compliment! :)

So I'm using Wistia because they're really the best video hosting platform for paid content (in my opinion). They have a great API, lots of awesome features like email capture during the video, and do a good job around protecting paid content. Overall, they can be a bit pricey but it's a great service for the business related features if you're looking for something like that.


I'm wanting to upload videos using the paperclip gem - any links you may have that can point me in the right direction? Thanks Chris!

You should be able to just upload them! Just make sure you don't include any validations that force images or styles that try to resize them. You'll just want to have raw uploads in that case. That's really all you need to do.

is there a way i can limit the video length - like instagrams video 15 second limit

You can probably create a validation for it somehow. You'd need something to read the video in Ruby and check the length. Ideally people are uploading the same format of video all the time so you can do that easily.


Hey Chris, I've got video uploads working locally(ffmpeg&paperclip)

I've pushed it up to heroku and for some reason i'm getting an error about a missing library - I'm guessing there is some buildpacks i have to set in heroku - I've tried couple options but it then pulls an error in my logs that says duplicate table - any suggestions?

Duplicate table as in database table from a migration?

I'm getting this back in heroku logs:
[AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
app/controllers/bscenes_controller.rb:6:in `create'
Av::UnableToDetect (Unable to detect any supported library):
-->
I'm using paperclips-transcoder for ffmpeg - in my model:
has_attached_file :video, styles: {
:medium => {
:geometry => "640x480",
:format => 'mp4'
},
:thumb => { :geometry => "160x120", :format => 'jpeg', :time => 10}
}, :processors => [:transcoder]

-->
I've read some references in heroku and there seems to be buildpacks that i have to add - im thinking? Any idea how i can get things going

That sounds about right. Ffmpeg isn't installed by default. You can probably use this: https://elements.heroku.com...

So i set that up and this shows in my Heroku log:

2015-10-15T23:32:34.491866+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=arcane-fjord-4302.herokuapp... request_id=31a49b33-974a-4c41-9bba-87807f8e7856 fwd="76.110.120.165" dyno= connect= service= status=503 bytes=

I've already set the heroku config BUILDPACK_URL and created a .buildpacks folder and pasted in the ffmpeg git link:

I followed this set up but im still getting the AV error:
https://elements.heroku.com...


Hey Chris, it seems i need wistia premium plan for using those features right?

I think every Wistia account offers the same features for the player stuff. You can try it on their free account to be sure though.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.