Skip to content
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-10510): iOS14 - cannot exit from native PiP by the player's PiP button #483

Merged
merged 5 commits into from
Oct 19, 2020

Conversation

yairans
Copy link
Contributor

@yairans yairans commented Sep 24, 2020

Description of the Changes

  • Don't use exitPictureInPicture when it's native PiP but use webkitSetPresentationMode('inline')
  • Remove the redundant LEAVE_PICTURE_IN_PICTURE firing. it's already fired natively.

Solves FEC-10510

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

@yairans yairans requested a review from a team September 24, 2020 12:28
@yairans yairans self-assigned this Sep 24, 2020
@yairans yairans changed the title fix(FEC-10510): iOS14 - cannot return from native PiP by the player's PiP button fix(FEC-10510): iOS14 - cannot exit from native PiP by the player's PiP button Sep 29, 2020
} else if (typeof this._el.webkitSetPresentationMode === 'function') {
this._el.webkitSetPresentationMode('inline');
// Safari does not fire this event but Chrome does, normalizing the behaviour
setTimeout(() => this.dispatchEvent(new FakeEvent(Html5EventType.LEAVE_PICTURE_IN_PICTURE)), 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need the event anymore?

Copy link
Contributor Author

@yairans yairans Sep 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I don't see where this code was relevant, in all safari I've checked (mac, iPad with ios 11, 12, 13, and ios 14) this code was unreachable (means the if was applied not the else if).
After this change, I see this event fired natively.

Yuvalke
Yuvalke previously approved these changes Oct 18, 2020
@yairans yairans merged commit ddf3a87 into master Oct 19, 2020
@yairans yairans deleted the FEC-10510 branch October 19, 2020 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants