Fallback image for Rail's video_tag

90 views
Skip to first unread message

Aaron Cordovez

unread,
Mar 29, 2015, 5:30:21 PM3/29/15
to rubyonra...@googlegroups.com
It seems like there is no way to provide a fallback image with Rail's video_tag.

Is there a specific reason that the method was created this way? http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html

Has anyone else come across the need to use a fallback image when using video_tag, or found a way to do it without using raw html?


Gabriel Sobrinho

unread,
Mar 30, 2015, 9:02:36 AM3/30/15
to rubyonra...@googlegroups.com
Seems like you can do it using the poster option.

Matt Jones

unread,
Mar 30, 2015, 9:39:19 AM3/30/15
to rubyonra...@googlegroups.com
On Mar 30, 2015, at 9:02 AM, Gabriel Sobrinho <gabriel....@gmail.com> wrote:

Seems like you can do it using the poster option.


I believe Aaron is referring to putting an `img` tag inside the `video` element, to accommodate browsers that don’t understand `video` at all.


Setting a placeholder won’t help those browsers, since they don’t handle the tag at all.

—Matt Jones

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-co...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

signature.asc

Jason Fleetwood-Boldt

unread,
Mar 30, 2015, 1:17:31 PM3/30/15
to rubyonra...@googlegroups.com



I think people using video_tag or picture_tag will probably be using polyfils or fallbacks. 

While we’re on the subject, it would be great to think long-term about supporting picture_tag too, generally it needs a polyfil and a CarrierWave/Paperclip integration, so it may or may not be something to integrate into the Rails core. 

I think Rails should take emerging standards (picture_tag and video_tag) seriously as we transition into this new territory. 

-Jason 

Jason Fleetwood-Boldt

unread,
Mar 30, 2015, 1:17:36 PM3/30/15
to rubyonra...@googlegroups.com
on that note any plans to support picture_tag (the emerging new standard for displaying pictures?)

something like what you see here: https://github.com/G5/picture_tag-rails



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-co...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Aaron Cordovez

unread,
Apr 6, 2015, 8:10:35 PM4/6/15
to rubyonra...@googlegroups.com
Yes Matt,

That is precisely what I am referring to.

-Aaron
Reply all
Reply to author
Forward
0 new messages