Very laggy HTML5 Video in Safari - html

I am having some trouble trying to figure out what is causing HTML5 video to be extremely slow loading/playing in Safari. I have tested the same below code on Chrome, Firefox, IE (irrelevant as it uses the flash) and the load/play times are nearly instant. But on Safari, I need to wait pretty much a whole minute before it starts playing. I had tried removing the video's 'autobuffer' parameter, but made no difference. Any ideas?
<video id="video-window" autoplay="autoplay" autobuffer="autobuffer">
<source src="testvideo.mp4" type='video/mp4' />
<source src="testvideo.webm" type='video/webm' />
<source src="testvideo.ogv" type='video/ogg; codecs="theora, vorbis"' />
<object type="application/x-shockwave-flash" data="player.swf" width="640" height="480">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="autoplay" value="true">
<param name="flashvars" value="testvideo.mp4">
<!--[if IE]><param name="movie" value="player.swf"><![endif]-->
<p>Your browser can’t play HTML5 video.</p>
</object>
</video>

You need to use Handbrake and check the Web optimized option when encoding. I have no clue why but this reduces Safari lag dramatically. Still not as speedy as other browsers but much better.

Related

Video will not play on Edge

I am using HTML5 to embed a video on my site. It works in all browsers except Edge.
Here is my code:
<video id="sampleMovie" width="509" height="280" preload autoplay>
<source src="breaking_news.mov" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source src="breaking_news.webm" type='video/webm; codecs="vp8, vorbis"' />
<source src="breaking_news.ogv" type='video/ogg; codecs="theora, vorbis"' />
<object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" width="640" height="360">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="transparent" />
<param name="flashvars" value='config={"clip":{"url":"breaking_news.flv","autoPlay":false,"autoBuffering":true}}' />
</object>
</video>
I removed the full URL for the purpose of posting here.
Any idea on why it will not play in Edge?
Based on the Edge browser video developer guide for mp4, this is what is supported:
Media File : Video MP4.
Extension setting : .mp4.
Mime type setting : video/mp4.
Based on the code you provided, the MP4 file you are providing has an extension type/container type of .mov which is not supported.
Thus, I recommend re-encoding your source video file so that it has the .mp4 extension type, more than likely this is the issue. I would also look at the specific codec type you are specifying.
Lastly, I recommend looking at their full dev guide found here: https://learn.microsoft.com/en-us/microsoft-edge/dev-guide/html5/video
Hope this helps.

Embedding video for Chrome without NPAPI support

Im building a site where video will be stream from mp4/m4v files on the server.
I am having trouble making this work in Chrome 47, evidently due to lack of NPAPI support.
Here are some variations of code I have tried and the results:
<video controls>
<param name="video" value="true" />
<source src="app/files/s1e1.m4v" type="video/mp4">
<source src="app/files/s1e1.m4v" type="video/ogg">
Your browser does not support the video tag.
</video>
Result: I get a javascript error frame with an message reading "This plugin is not supported"
<object width="100%" height="360">
<param name="movie" value="app/files/s1e1.m4v"/
<param name="allowFullScreen" value="true"/>
<param name="allowscriptaccess" value="always"/>
<embed width="100%" height="360" src="app/files/s1e1.m4v" class="youtube-player" type="text/html" allowscriptaccess="always" allowfullscreen="true"/>
</object>
Result: The player renders and seems to load the file evidenced by the correct video length being displayed in the player, but video does not play when I hit the play button.
Either method works perfectly in Safari.
Which method is best for cross-browser support?

Video lag/pixelation in Safari

I am uploading .mp4, .webm, .ogv, .swf files to our servers for video playback. We are using the code below for cross-browser/fallbacks.
<video width="570" height="338" tabindex="0" loop="loop" controls="controls" autoplay="autoplay">
<source type="video/mp4" src="/Resources/videos/product.mp4"></source>
<source type="video/webm" src="/Resources/videos/product.webmsd.webm"></source>
<source type="video/ogg" src="/Resources/videos/product.oggtheora.ogv"></source>
<object width="570" height="338" type="application/x-shockwave-flash" data="/Resources/videos/product.swf">
<param wmode="opaque" value="/Resources/videos/product.swf" name="movie">
<param value="false" name="allowFullScreen">
<param value="transparent" name="wmode">
<param value="config={'playlist':['http%3A%2F%2Fbeta.com',{'url':'http%3A%2F%2Fbeta.com%2FResources%2Fvideos%2Fproduct.mp4','autoPlay':false}]}" name="flashVars">
</object>
</video>
The videos work flawless in IE, Chrome, Firefox, and Safari (windows). However the video lags and is pixelated in Safari on Mac. See image below:
I am wondering if anyone has come across this issue before and could steer me in the right direction to fix it. Thank you all in advance.

display mp4 video in html5

I'm trying to get my site using html5 instead of those ancient horrible horrible embed/object stuff. I exported the html to a test page.
It doesn't work for me in Firefox or Chrome (on a Mac). Here are the goodies on this page:
<video width="500" height="350" controls="controls">
<source src="/temp/output.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" standby="video loading" scale="aspect" HEIGHT="350" WIDTH="500" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<PARAM NAME="src" VALUE="/content/preview/350/aerial-tour-of-thebes-ramusseum.mov" >
<PARAM NAME="autoplay" VALUE="true" >
<param name="controller" value="true"><param name="loop" value="true">
<param name="scale" value="aspect"/>
<EMBED scale="aspect" HEIGHT="350" WIDTH="500" TYPE="video/quicktime" PLUGINSPAGE="http://www.apple.com/quicktime/download/" SRC="/content/preview/350/aerial-tour-of-thebes-ramusseum.mov" controller="true" loop="true" AUTOPLAY="true"/>
</OBJECT>
</video>
Two questions :
what's wrong with this code? I know mp4 is a valid format for html5, right? What's the deal? and
Isn't the point of all of this to degrade nicely in browsers that don't have support? I just see a gray box with an x in it. Shouldn't it execute the object/embed stuff and show the video the way it used to?
Some browsers doesn't support MPEG4 for licensing reasons. This format is patented, so developers of these browsers would have to buy patent license for every user of their browser.
Firefox currently supports Ogg Theora and WebM.
Here you have format support matrix across various browsers/operating systems:
http://en.wikipedia.org/wiki/HTML5_video#Table

audio in internet explorer and cross-browser

I have an audio element in a webpage for a client and i have coded it as well as i can but i still can't get it to work on All browsers. I know cross browser and browser editions (i.e. internet explorer 6,7,8,9 ) with audio is tricky but there has to be an answer here. Can this be done and without needing browser plugins? Here is my current code.
<audio preload="auto" autobuffer autoplay="autoplay">
<source src="http://brodysfurniture.com/wp-content/themes/Brodys/images2/08_Track_8.mp3"/>
<source src="http://brodysfurniture.com/wp-content/themes/Brodys/images2/08_Track_8.ogg" />
<source src="http://brodysfurniture.com/wp-content/themes/Brodys/images2/08_Track_8.wav" />
<source src="http://brodysfurniture.com/wp-content/themes/Brodys/images2/08_Track_8.au" />
<source src="http://brodysfurniture.com/wp-content/themes/Brodys/images2/08_Track_8.wma" />
<!-- browser compatibility fallbacks -->
<object>
<param name="autostart" value="true">
<param name="src" value="http://brodysfurniture.com/wp-content/themes/Brodys/images2/08_Track_8.wav">
<param name="autoplay" value="true">
<param name="controller" value="false">
<embed src="http://brodysfurniture.com/wp-content/themes/Brodys/images2/08_Track_8.wav" controller="false" HIDDEN="TRUE" autoplay="true" autostart="True" type="audio/wav" />
<embed src="http://brodysfurniture.com/wp-content/themes/Brodys/images2/08_Track_8.mp3" controller="false" HIDDEN="TRUE" autoplay="true" autostart="True" type="audio/mpeg" />
</object>
<!-- End browser compatibility fallbacks -->
</audio>
I would look here for some answers. I personally have made a page that uses the native <audio> element but provides a WMP fall back for the less tech savvy users that insist on using old deprecated software.