Embedded media player gets inconsistent currentPosition on both IE8 and Firefox3
I have a embedded media player in the browser that is controlled by j开发者_如何学Pythonavascript to handle all the mediaChange event. The code looks like
mediaChangeHandler: function(media) {
if (media && this.offset && !this.offsetJumpPerformed) {
if (parseFloat(media.duration) > this.offset) {
pos = parseInt(pos);
this.getPlayer().controls.currentPosition = pos;
alert("jump to position: " + this.getPlayer().controls.currentPosition);
this.play();
this.offsetJumpPerformed = true;
alert("currentPosition:" + this.getPlayer().controls.currentPosition);
}
}
}
The first alert indicates the currentPosition is where I want it to be. However, the second alert would get currentPosition that's couple seconds less than what I have set up.
Does anyone have idea why? I tried googled it but haven't found anything useful. Thanks!
This is a bug introduced with WMP10 and present also in WMP11, while Windows Media Player 9 worked perfectly. I didn't find any workaround to correct this behavior...
精彩评论