javascript - video.js currentTime() incorrect until timeupdate event fires -


i've noticed small inconsistency i'm hoping verify either quirk of html5, or specific video.js.

it seems if call video.js' currenttime() function whilst providing new time, further calls currenttime() (to current time) not return correct time (it return previous time), until timeupdate event fires. after timeupdate event, currenttime() return correct time.

for example, assuming video hasn't started playing yet, video.js has loaded, along video meta etc:

videoplayer.addevent('timeupdate', function() {     console.log('event callback: ' + player.currenttime);  }); console.log('original time: ' + player.currenttime);   player.currenttime(100);           console.log('new time: ' + player.currenttime);   

the output expecting like:

original time: 0 new time: 100 event callback: 100 

however i've receiving is:

original time: 0 new time: 0 event callback: 100 

any insight fantastic!

edit: can reproduce in chrome , safari on osx, not firefox on osx (all using html5). can reproduce on ie8 using flash player , ie9 using html5 player.

i've seen similar behaviour on several other html5/flash players.

i've been under assumption after seeking via currenttime(100);, playhead not updated until next timeupdate event.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -