Forum: Ruby on Rails Rails Play video

Posted by Maddy (Guest)
on 2013-01-31 13:33
(Received via mailing list)
Hi Folks,

I want play videos, the src file should i get from assets/videos.

I just created one folder in my assets like videos and placed one .mov 
file.

In my view,

<video width="320" height="240" controls="controls">
  <source src="/assets/videos/demo.mov" type="video/mov" />
   Your browser does not support the video tag.
</video>

But its not working. Please advice.
Posted by Walter Davis (walterdavis)
on 2013-01-31 18:04
(Received via mailing list)
I don't think you use the assets part of the path in Rails 3.1+. Try it 
with just /videos/video.mov and see what happens then.

Walter
Posted by tamouse mailing lists (Guest)
on 2013-02-02 04:49
(Received via mailing list)
On Thu, Jan 31, 2013 at 11:02 AM, Walter Lee Davis <waltd@wdstudio.com> 
wrote:
>> I just created one folder in my assets like videos and placed one .mov file.
>>
>> In my view,
>>
>> <video width="320" height="240" controls="controls">
>>   <source src="/assets/videos/demo.mov" type="video/mov" />
>>    Your browser does not support the video tag.
>> </video>
>>
>> But its not working. Please advice.

Using the HTML you have above, you'd need to house the movie under
#{Rails.root}/public somewhere, rather than #{Rails.root}/app/assets,
probably something like:

#{Rails.root}/
  public/
    videos/
      demo.mov


Then, your source tag should use:

src="/videos/demo.mov"

I would definitly keep such large things out of the asset pipeline, as
it would bog down assets:precompile a lot.

It's also something I'd definitely not want in my repository with my
code; I'd have some other way of versioning/deploying it.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.