mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-12 15:52:44 +02:00
fullscreen fallback to video #62.
This commit is contained in:
parent
3dbb265ef3
commit
8177b23557
2 changed files with 27 additions and 11 deletions
|
@ -478,24 +478,40 @@
|
|||
this.$accessor.remote.toggle()
|
||||
}
|
||||
|
||||
requestFullscreen() {
|
||||
if (typeof this._player.requestFullscreen === 'function') {
|
||||
this._player.requestFullscreen()
|
||||
_elementRequestFullscreen(el: HTMLElement) {
|
||||
if (typeof el.requestFullscreen === 'function') {
|
||||
el.requestFullscreen()
|
||||
//@ts-ignore
|
||||
} else if (typeof this._player.webkitRequestFullscreen === 'function') {
|
||||
} else if (typeof el.webkitRequestFullscreen === 'function') {
|
||||
//@ts-ignore
|
||||
this._player.webkitRequestFullscreen()
|
||||
el.webkitRequestFullscreen()
|
||||
//@ts-ignore
|
||||
} else if (typeof this._player.webkitEnterFullscreen === 'function') {
|
||||
} else if (typeof el.webkitEnterFullscreen === 'function') {
|
||||
//@ts-ignore
|
||||
this._player.webkitEnterFullscreen()
|
||||
el.webkitEnterFullscreen()
|
||||
//@ts-ignore
|
||||
} else if (typeof this._player.msRequestFullScreen === 'function') {
|
||||
} else if (typeof el.msRequestFullScreen === 'function') {
|
||||
//@ts-ignore
|
||||
this._player.msRequestFullScreen()
|
||||
el.msRequestFullScreen()
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
this.onResise()
|
||||
return true
|
||||
}
|
||||
|
||||
requestFullscreen() {
|
||||
// try to fullscreen player element
|
||||
if (this._elementRequestFullscreen(this._player)) {
|
||||
this.onResise()
|
||||
return
|
||||
}
|
||||
|
||||
// fallback to fullscreen video itself (on mobile devices)
|
||||
if (this._elementRequestFullscreen(this._video)) {
|
||||
this.onResise()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
requestPictureInPicture() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue