How do I add event listener to videojs when the video is start to play? (this event should be called at the begging of the play)?
I searched on Player Events docs, but I can't find any event that tell me "now the video is start play".
js setup methods are used to initialize a video. var myPlayer = videojs('example_video_1'); In the following example, the data-setup attribute tells the Video. js library to create a player instance when the library is ready.
Using the once option We can pass an object as an argument to the addEventListener method and specify that the event is only handled once. This is achieved by passing the property once to the object. If we set once to true, the event will only be fired once.
Audio tracks are supported in Video. js's MSE playback engine for HLS and DASH. Safari also supports audio tracks for native playback of HLS and MP4. Other browsers do not support audio tracks for native playback including MP4, so it is not possible to work with MP4 audio tracks in Chrome or Firefox for example.
You can do this videojs way.
play.on('play', () => { });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With