Handle player being removed

This commit is contained in:
Gabe Kangas 2022-07-12 14:12:58 -07:00
parent 678d5c9fd6
commit 6ee2866260
No known key found for this signature in database
GPG key ID: 9A56337728BC81EA

View file

@ -46,6 +46,7 @@ class PlaybackMetrics {
this.handleBuffering = this.handleBuffering.bind(this);
this.handleEnded = this.handleEnded.bind(this);
this.handleError = this.handleError.bind(this);
this.send = this.send.bind(this);
this.collectPlaybackMetrics = this.collectPlaybackMetrics.bind(this);
this.handleNoLongerBuffering = this.handleNoLongerBuffering.bind(this);
@ -225,7 +226,7 @@ class PlaybackMetrics {
}
// If we're paused then do nothing.
if (this.player.paused()) {
if (!this.player || this.player.paused()) {
return;
}