function initWMVPlayer(objPlayer, theFile) {
objPlayer.sendEvent('LOAD', theFile);
objPlayer.sendEvent('PLAY', 'true');
}
This seemed to work when I associated it with the click event on a playlist, but sporadically. Sometimes it worked on the first click, sometimes on the 2nd click. Then I found some references (this blog and this forum) that said you always should have a delay before sending the PLAY event. So the function should look like this:
function initWMVPlayer(objPlayer, theFile) {
objPlayer.sendEvent('LOAD', theFile);
setTimeout(function() {objPlayer.sendEvent('PLAY', 'true');}, 50);
}
No comments:
Post a Comment