The code in John Dyer s answer didn t really work for me either for some reason. I was however able to get this version working...
var videoPlayer = new MediaElementPlayer( #homepage-player , {
loop: false,
features:[],
enablePluginDebug: false,
plugins: [ flash , silverlight ],
pluginPath: /js/mediaelement/ ,
flashName: flashmediaelement.swf ,
silverlightName: silverlightmediaelement.xap ,
success: function (mediaElement, domObject) {
// add event listener
mediaElement.addEventListener( ended , function(e) {
mediaElement.pause();
mediaElement.setCurrentTime(mediaElement.duration);
}, false);
},
error: function () {
}
});
videoPlayer.play();
The only problem I m having - which is very frustrating, is it is flickering between the LAST and FIRST frames in Chrome. Otherwise, it works as expected in Firefox and IE...