views:

25

answers:

0

I have a embedded media player in the browser that is controlled by javascript 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!