Video.js - loadeddata event never fires

后端 未结 2 1585
不知归路
不知归路 2021-01-03 06:17

I am integrating Video.js into a project and having a few issues.

I have it in my HTML as:

2条回答
  •  梦毁少年i
    2021-01-03 06:45

    loadeddata won't necessarily fire before playback starts. In Flash it never does, with HTML5 the event is relayed from the video element so it depends on the browser behaviour.

    loadedalldata is when the entire video is downloaded, so is unlikely to occur before playback starts.

    You specify which function to remove from the event because you could have bound more than one function to the event, e.g.

    vidPlayer.addEvent("play", onPlay1 );
    vidPlayer.addEvent("play", onPlay2 );
    vidPlayer.removeEvent("play", onPlay1 ); // onPlay2() would still be executed
    

提交回复
热议问题