Vimeo fix

This commit is contained in:
Sam Potts
2018-03-15 10:29:05 +11:00
parent c74b75e8e1
commit 5cb1628cd8
16 changed files with 50 additions and 5860 deletions

View File

@@ -1029,6 +1029,10 @@ class Plyr {
* @param {boolean} soft - Whether it's a soft destroy (for source changes etc)
*/
destroy(callback, soft = false) {
if (!this.ready) {
return;
}
const done = () => {
// Reset overflow (incase destroyed while in fullscreen)
document.body.style.overflow = '';
@@ -1071,6 +1075,9 @@ class Plyr {
callback.call(this.elements.original);
}
// Reset state
this.ready = false;
// Clear for garbage collection
setTimeout(() => {
this.elements = null;