mediaelement.js - mediaelement js - show poster and play icon when finished playing -


i'd poster play icon show when video has finished playing.

did try achieve yet?

yes, tried myself project client wanted poster image come when video had completed. here's code:

    jquery("video").mediaelementplayer({         features: ["playpause","progress","current","duration","volume","fullscreen"],         success:  function (mediaelement, domobject) {              mediaelement.addeventlistener("ended", function(e){                  // revert poster image when ended                 var $thismediaelement = (mediaelement.id) ? jquery("#"+mediaelement.id) : jquery(mediaelement);                 $thismediaelement.parents(".mejs-inner").find(".mejs-poster").show();             });         }     }); 

the mediaelement player instantiated in usual way. i've added 'success' function listen "ended" event, takes our mediaelement object , traverses dom find poster image layer , switch on.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -