Makes no sense, as long as the <video> content is displayed properly
in the html that is generated, it doesn't matter if its rails, php,
python, java, or anything else serving it. browsers read source code
as it is. Rails has nothing to do with your video code.
Here is some sample code of a basic html5 video I use with fallback
support to a flash player for legacy browsers. Do some testing, first
load it in an html in your public folder, if it plays fine in modern
browsers, great. Then load it into a html.erb in your views folder,
make sure everything is routed correctly and configured in your views/
controllers appropriately. If it will load in safari, it will load on
your iphone/pad fine. The below code I've tested and used on all apple
devices, android devices, safari, firefox, chrome, and even older
browsers will default to the fallback flash player, send me a message
if you still don't get it. Remember, it is good practice to code mp4
for webkit browsers, ogg for firefox/opera, and flash flv for IE &
older browsers.
code =>
<video width="741" height="320" controls="controls"
preload="auto" poster="http://video-js.zencoder.com/oceans-clip.png"
>
<source src="http://video-js.zencoder.com/oceans-clip.mp4"
type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source src="http://video-js.zencoder.com/oceans-clip.webm"
type='video/webm; codecs="vp8, vorbis"' />
<source src="http://video-js.zencoder.com/oceans-clip.ogv"
type='video/ogg; codecs="theora, vorbis"' />
<!-- Flash Fallback. Use any flash video player here. -->
<object width="741" height="320" type="application/x-shockwave-
flash"
data="http://releases.flowplayer.org/swf/
flowplayer-3.2.1.swf">
<param name="movie" value="http://releases.flowplayer.org/swf/
flowplayer-3.2.1.swf" />
<param name="allowfullscreen" value="true" />
<param name="flashvars" value='config={"playlist":["http://
video-js.zencoder.com/oceans-clip.png", {"url": "http://video-
js.zencoder.com/oceans-
clip.mp4","autoPlay":false,"autoBuffering":true}]}' />
<!-- Image Fallback. Typically the same as the poster image. --
>
<img src="http://video-js.zencoder.com/oceans-clip.png"
width="741" height="320" alt="Poster Image" title="No video playback
capabilities." />
<!-- Download links provided for devices that can't play video in
the browser. -->
<img src="http://video-js.zencoder.com/oceans-clip.png"
width="741" height="320" alt="Poster Image" />
<p><strong>Download Video:</strong>
<a href="http://video-js.zencoder.com/oceans-clip.mp4">MP4</a>,
<a href="http://video-js.zencoder.com/oceans-clip.webm">WebM</
a>,
<a href="http://video-js.zencoder.com/oceans-clip.ogv">Ogg</
a><br>
</p>
</object>
</video>
On Dec 28 2010, 11:44 pm, dare ruby <li...@ruby-forum.com> wrote:
> Dear Friends,
>
> Am in process of building a video player rails application, which is
> compatabile to Safari, ipad, iphone device.
>
> I have used below code to render a video and it works fine in safari.
> But videos are not played in ipad and iphone.
>
> <video width="560" height="330" controls="controls"
> autobuffer="autobuffer">
>
> <source src="/videos/video.ogv" type="video/ogg" />
> <source src="/videos/movie.mp4" type="video/mp4" />
>
> </video>
>
> I have tried changing the mime types, in config folder like,
>
> Mime::Type.register "video/mp4", :mp4
> Mime::Type.register "video/mp4", :m4v
>
> Rack::Mime::MIME_TYPES.merge!({
> ".ogg" => "application/ogg",
> ".ogx" => "application/ogg",
> ".ogv" => "video/ogg",
> ".oga" => "audio/ogg",
> ".mp4" => "video/mp4",
> ".m4v" => "video/mp4",
> ".mp3" => "audio/mpeg",
> ".m4a" => "audio/mpeg"
>
> })
>
> but the issue not fixed yet.
>
> Iam using rails 3.0.0 and ruby 1.87.7
>
> Kindly let me know what needs to be done to get videos played in ipad
> and iphone using HTML5 and Rails 3.
>
> Regards,
> Jose
>
> --
> Posted viahttp://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment