I am using video.js video player.
I am having an application that is loaded in multiple browsers. The application has a video.js video player loaded in it. One of the app serves as the master or the controller app. The others are controlled apps.
Using websockets I want to send control messages from the master player to the controlled players.
I want the following actions mimicked in the controlled player from the master player:
Are there callbacks provided when a user initiates these controls in the player? If so, is there sufficient data passed to the callback so that this data can, in turn, through websockets, be passed to a remote player to perform the same action?
Any pointers will be helpful.
Yes, you can try listening to these events from videojs player: volumechange
, play
, pause
, seeked
,
Your code will look like something like this:
this.player.on("volumechange", (e) => forwardEventToWebSocket(e));
Documentation of all events is available here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#events