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

[REGRESSION] Leaving or entering PIP pause the video #948

Closed
kelson42 opened this issue Aug 21, 2024 · 1 comment · Fixed by #952
Closed

[REGRESSION] Leaving or entering PIP pause the video #948

kelson42 opened this issue Aug 21, 2024 · 1 comment · Fixed by #952
Assignees
Labels
Milestone

Comments

@kelson42
Copy link
Contributor

... and it should not.

Tested with https://library.kiwix.org/#lang=&q=astrolab, testflight and iPadOS18.

@kelson42 kelson42 added the bug label Aug 21, 2024
@kelson42 kelson42 added this to the 3.5.1 milestone Aug 21, 2024
@BPerlakiH
Copy link
Collaborator

BPerlakiH commented Aug 22, 2024

Media pause issues:

Point of regression started at:

Fix video stop, when tab is closed
Here we hooked into the tab (which has a browser) disappearing.

Overall the .onDisappear event is too broad:

It covers all of the following cases:

  • current tab is closed
  • we switched to another tab (or section)
  • the application is backgrounded

Therefore triggering based on .onDisappear is misleading, as in picture in picture we should not do anything, in any of those cases (closing tab, switching to another tab, or backgrounding the app).

On the other hand all the above cases are valid for "inline" small video player.

iPad specific additional issues:

  • if we re-select the already selected tab where the video comes from, it refreshes, and pauses the video both in picture in picture and when the video player is "inline" / small.

iPhone issues:

This is somewhat more complicated than the iPad issue.
The order of events is slightly different than on the iPad.
We get the current browser instance from the so called "Environment", which is updated to the "current instance" every time we switch tabs, which is in itself OK.

The problem with the current implementation is the following:

  • if we play the video "inline" and switch to another tab the video keeps playing (whereas it is expected to pause)
  • if we switch back from another tab to the tab containing the video (while the video was still incorrectly playing), the video will pause. The same steps are also causing the video to pause in picture in picture.

The reason for this, is most likely that by the time the .onDisappear is called, the browser is pointing to the "newly selected" instance (via the Environment inject), and the pause is called on that.

macOS behaviour:

Although there's no picture in picture on macOS, the video playing has the following behaviour:
Playing video from the first tab:

  • keeps on playing if we open a new window/tab (eg: via CMD+T),
    which is in itself not that bad, as the user can eg. split the screen and read something else in the meantime on another tab, it is also possible to play 2 videos simultaneously from two separate windows.
  • the video will pause if we switch to another left menu item (within the same window) eg. Bookmarks, Opened, Categories, Downloads, News, which makes sense as the video is no longer visible.

@kelson42 I will start with fixing the iPad and iPhone issues.
I am not sure if the macOS behaviour should remain, or we want to change it in any way.
IMHO there's no bug on macOS, but at least we have this documented for all devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants