Ruby on Rails Friday, February 1, 2013

On Thu, Jan 31, 2013 at 11:02 AM, Walter Lee Davis <waltd@wdstudio.com> wrote:
> 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
>
> On Jan 31, 2013, at 7:31 AM, Maddy wrote:
>
>> 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.

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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment