Update fullscreen.js
This commit is contained in:
parent
212db32d05
commit
8b9cc21c96
|
|
@ -36,8 +36,10 @@ class FullScreen {
|
|||
}
|
||||
}
|
||||
|
||||
request (type = 'browser', switchmode) {
|
||||
if (!switchmode) {
|
||||
request (type = 'browser') {
|
||||
const anotherType = type === 'browser' ? 'web' : 'browser';
|
||||
this.anotherTypeOn = this.isFullScreen(anotherType);
|
||||
if (!this.anotherTypeOn) {
|
||||
this.lastScrollPosition = utils.getScrollPosition();
|
||||
}
|
||||
|
||||
|
|
@ -62,6 +64,10 @@ class FullScreen {
|
|||
this.player.events.trigger('webfullscreen');
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.anotherTypeOn) {
|
||||
this.cancel(anotherType);
|
||||
}
|
||||
}
|
||||
|
||||
cancel (type = 'browser') {
|
||||
|
|
@ -90,14 +96,7 @@ class FullScreen {
|
|||
this.cancel(type);
|
||||
}
|
||||
else {
|
||||
const anotherType = type === 'browser' ? 'web' : 'browser';
|
||||
if (this.isFullScreen(anotherType)) {
|
||||
this.request(type, true);
|
||||
this.cancel(anotherType);
|
||||
}
|
||||
else {
|
||||
this.request(type);
|
||||
}
|
||||
this.request(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue