|
|
|
@ -211,11 +211,12 @@ class OwncastPlayer { |
|
|
|
this.appPlayerPlayingCallback(); |
|
|
|
this.appPlayerPlayingCallback(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!this.hasStartedPlayback) { |
|
|
|
if (this.latencyCompensator && !this.hasStartedPlayback) { |
|
|
|
this.latencyCompensator.enable(); |
|
|
|
this.latencyCompensator.enable(); |
|
|
|
this.hasStartedPlayback = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.hasStartedPlayback = true; |
|
|
|
|
|
|
|
|
|
|
|
setInterval(() => { |
|
|
|
setInterval(() => { |
|
|
|
this.collectPlaybackMetrics(); |
|
|
|
this.collectPlaybackMetrics(); |
|
|
|
}, 5000); |
|
|
|
}, 5000); |
|
|
|
@ -223,6 +224,10 @@ class OwncastPlayer { |
|
|
|
|
|
|
|
|
|
|
|
collectPlaybackMetrics() { |
|
|
|
collectPlaybackMetrics() { |
|
|
|
const tech = this.vjsPlayer.tech({ IWillNotUseThisInPlugins: true }); |
|
|
|
const tech = this.vjsPlayer.tech({ IWillNotUseThisInPlugins: true }); |
|
|
|
|
|
|
|
if (!tech || !tech.vhs) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const bandwidth = tech.vhs.systemBandwidth; |
|
|
|
const bandwidth = tech.vhs.systemBandwidth; |
|
|
|
this.playbackMetrics.trackBandwidth(bandwidth); |
|
|
|
this.playbackMetrics.trackBandwidth(bandwidth); |
|
|
|
|
|
|
|
|
|
|
|
@ -242,6 +247,7 @@ class OwncastPlayer { |
|
|
|
if (this.appPlayerEndedCallback) { |
|
|
|
if (this.appPlayerEndedCallback) { |
|
|
|
this.appPlayerEndedCallback(); |
|
|
|
this.appPlayerEndedCallback(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.latencyCompensator.disable(); |
|
|
|
this.latencyCompensator.disable(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|