Skip to content

Support Picture-in-Picture on Chrome OS

Kazuki Takise requested to merge takise/vlc-android:takise-pip-chromeos into master

enterPictureInPictureMode() must be called in onUserLeaveHint() to support Picture-in-Picture in a multi-window environment such as Chrome OS.

The current implemententation (calling the API in onPause()) causes the following issues on Chrome OS:

  • VLC enters PiP without being occluded, but just with another window activated. In a multi-window environment, we can't assume onPause() means the window gets hidden. As only one window can be resumed at the same time, it's possible that a window is fully visible, but paused.
  • When some ChromeOS-specific system UI gets shown (e.g. Alt-Tab window cycler, Overview Mode), VLC enters PiP unexpectedly.

This patch moves switchToPopup() from onPause() to onUserLeaveHint() to prevent those issues.

Tested the patch on a Pixel 2 and some Chromebooks and confirmed Picture-in-Picture worked well and nothing was broken on all of those devices.

Edited by Kazuki Takise

Merge request reports

Loading