Fixed errors when Plyr instance is destroyed before constructor setTimeout() functions execute. (#2108)
Co-authored-by: Emilis Dambauskas <emilis.dambauskas@mps.fi>
This commit is contained in:
parent
d41a90f0dd
commit
f016a367b5
@ -154,7 +154,9 @@ const captions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enable or disable captions based on track length
|
// Enable or disable captions based on track length
|
||||||
toggleClass(this.elements.container, this.config.classNames.captions.enabled, !is.empty(tracks));
|
if (this.elements) {
|
||||||
|
toggleClass(this.elements.container, this.config.classNames.captions.enabled, !is.empty(tracks));
|
||||||
|
}
|
||||||
|
|
||||||
// Update available languages in list
|
// Update available languages in list
|
||||||
if (
|
if (
|
||||||
|
@ -675,7 +675,9 @@ class Plyr {
|
|||||||
|
|
||||||
// Set media speed
|
// Set media speed
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.media.playbackRate = speed;
|
if (this.media) {
|
||||||
|
this.media.playbackRate = speed;
|
||||||
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user