开发者

How to autostart and loop a movie...?

开发者 https://www.devze.com 2023-02-21 18:42 出处:网络
...and showing nothing than开发者_如何转开发 the movie itself? This should work with *.mp4, *.ogv *webm and the flash fallback

...and showing nothing than开发者_如何转开发 the movie itself? This should work with *.mp4, *.ogv *webm and the flash fallback

Any help appreciated!


I don't know what language you are using. But here is an article that explains tags converning videos. Search for "autostart"

http://www.tizag.com/htmlT/htmlvideocodes.php


Here is the javascript code to start the movie automatically:

var settings = {};

settings.success = function( mediaElement, domObject ) {
   // if using the Flash player, we need to listen to the `canplay` event
   if (mediaElement.pluginType == 'flash') {
      mediaElement.addEventListener('canplay', function() {
         // Player is ready
         mediaElement.play();
      }, false);
   } else {
         // call the play method
         mediaElement.play();
      }
   };

// the controls, we don't want any of them
settings.features = [];

$( 'video' ).mediaelementplayer( settings );

And here is the CSS code to hide the play icon in the center of the movie window:

.mejs-overlay-button {
    display: none;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消