play monitoring improvement (#4670)

This commit is contained in:
CJ
2024-03-11 21:33:28 -05:00
committed by GitHub
parent 9f5b1c33f6
commit 3521dc133e

View File

@@ -25,10 +25,18 @@ class TrackActivityPlugin extends videojs.getPlugin("plugin") {
constructor(player: VideoJsPlayer) {
super(player);
player.on("play", () => {
player.on("playing", () => {
this.start();
});
player.on("waiting", () => {
this.stop();
});
player.on("stalled", () => {
this.stop();
});
player.on("pause", () => {
this.stop();
});