-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(FEC-10513): iOS14 - cannot enter to full screen from PiP #484
Conversation
src/engines/html5/html5.js
Outdated
// Second condition is because flow does not support this API yet | ||
if (document.pictureInPictureEnabled && typeof this._el.requestPictureInPicture === 'function') { | ||
if (typeof this._el.webkitSetPresentationMode === 'function') { | ||
this._el.webkitSetPresentationMode('picture-in-picture'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move 'picture-in-picture' to const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's browser's string. we use it as is (like 'function', 'inline', 'playsinline' and many more)
src/engines/html5/html5.js
Outdated
} else if (typeof this._el.webkitSetPresentationMode === 'function') { | ||
this._el.webkitSetPresentationMode('picture-in-picture'); | ||
// Safari does not fire this event but Chrome does, normalizing the behaviour | ||
setTimeout(() => this.dispatchEvent(new FakeEvent(Html5EventType.ENTER_PICTURE_IN_PICTURE)), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you miss this event on your change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. it's not actually needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it changed on #483
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. here I changed enterPictureInPicture
. there I changed exitPictureInPicture
.
videoElement.webkitEnterFullScreen(); | ||
if (this._player.isInPictureInPicture()) { | ||
// iOS < 13 (iPad) has an issue to enter to full screen from PiP | ||
setTimeout(() => videoElement.webkitEnterFullScreen(), 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s just move the 1000 magic number to const at the top, beside that LGTM.
Description of the Changes
isFullscreen
- was returntrue
on PiPSolves FEC-10513
CheckLists