Replace provider switch plyr.js with conditions
This commit is contained in:
parent
2aa967aba9
commit
87ea5e14b4
@ -1028,10 +1028,8 @@ class Plyr {
|
||||
// Stop playback
|
||||
this.stop();
|
||||
|
||||
// Type specific stuff
|
||||
switch (`${this.provider}:${this.type}`) {
|
||||
case 'html5:video':
|
||||
case 'html5:audio':
|
||||
// Provider specific stuff
|
||||
if (this.isHTML5) {
|
||||
// Clear timeout
|
||||
clearTimeout(this.timers.loading);
|
||||
|
||||
@ -1040,10 +1038,7 @@ class Plyr {
|
||||
|
||||
// Clean up
|
||||
done();
|
||||
|
||||
break;
|
||||
|
||||
case 'youtube:video':
|
||||
} else if (this.isYouTube) {
|
||||
// Clear timers
|
||||
clearInterval(this.timers.buffering);
|
||||
clearInterval(this.timers.playing);
|
||||
@ -1055,10 +1050,7 @@ class Plyr {
|
||||
|
||||
// Clean up
|
||||
done();
|
||||
|
||||
break;
|
||||
|
||||
case 'vimeo:video':
|
||||
} else if (this.isVimeo) {
|
||||
// Destroy Vimeo API
|
||||
// then clean up (wait, to prevent postmessage errors)
|
||||
if (this.embed !== null) {
|
||||
@ -1067,11 +1059,6 @@ class Plyr {
|
||||
|
||||
// Vimeo does not always return
|
||||
setTimeout(done, 200);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user