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