Created
June 27, 2012 09:26
-
-
Save larswittenberg/3002846 to your computer and use it in GitHub Desktop.
MediaElement.js with autoplay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddType video/ogg .ogv | |
AddType video/mp4 .mp4 | |
AddType video/webm .webm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SOURCE: | |
http://mediaelementjs.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<video id="player1" width="940" height="528" poster="video/01.jpg" preload="none"> | |
<source type="video/mp4" src="video/01.mp4"> | |
<source type="video/webm" src="video/01.webm"> | |
<object width="940" height="528" type="application/x-shockwave-flash" data="js/ext/videoplayer/flashmediaelement.swf"> | |
<param name="movie" value="js/ext/videoplayer/flashmediaelement.swf"> | |
<param name="flashvars" value="controls=true&file=video/01.mp4"> | |
<img src="video/01.jpg" width="940" height="528" title="Kein kompatibles Video vorhanden"> | |
</object> | |
</video> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Video Player mit MediaElementjs | |
var player1; | |
if($('#player1').length > 0){ | |
if($.browser.msie) { | |
$('#player1').attr('autoplay', 'true'); | |
} | |
player1 = new MediaElementPlayer('#player1', { | |
features: [], | |
loop: true, | |
startVolume: 0.0 | |
}); | |
if(!$.browser.msie) { | |
player1.play(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment