Skip to content

Commit

Permalink
Disable fullscreen on iPhone (not supported yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoriiis committed Sep 1, 2022
1 parent f24b5af commit 49c9567
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vlite/assets/scripts/vlite.ts
Expand Up @@ -127,6 +127,11 @@ class Vlitejs {
this.autoHideGranted =
this.type === 'video' && !!this.options.autoHide && !!this.options.controls

// Disable fullscreen on iPhone, not supported yet
if (/(iPhone)/gi.test(window.navigator.userAgent)) {
this.options.fullscreen = false
}

this.onClickOnPlayer = this.onClickOnPlayer.bind(this)
this.onDoubleClickOnPlayer = this.onDoubleClickOnPlayer.bind(this)
this.onKeydown = this.onKeydown.bind(this)
Expand Down Expand Up @@ -188,7 +193,7 @@ class Vlitejs {
this.container.addEventListener('click', this.onClickOnPlayer)
this.container.addEventListener('dblclick', this.onDoubleClickOnPlayer)
this.autoHideGranted && this.container.addEventListener('mousemove', this.onMousemove)
window.addEventListener(this.supportFullScreen.changeEvent, this.onChangeFullScreen)
document.addEventListener(this.supportFullScreen.changeEvent, this.onChangeFullScreen)
}
this.container.addEventListener('keydown', this.onKeydown)
}
Expand Down

0 comments on commit 49c9567

Please sign in to comment.