Added onError eventListener to the youtube iframe video player to destroy itself whenever it receives any errors
This commit is contained in:
@@ -142,7 +142,11 @@ function setCurrentSrc(instance, elem, options) {
|
||||
} else if (event.data === YT.PlayerState.PAUSED) {
|
||||
events.trigger(instance, 'pause');
|
||||
}
|
||||
}
|
||||
},
|
||||
'onError': () => {
|
||||
instance.destroy();
|
||||
loading.hide();
|
||||
},
|
||||
},
|
||||
playerVars: {
|
||||
controls: 0,
|
||||
|
||||
Reference in New Issue
Block a user