GithubHelp home page GithubHelp logo

Comments (1)

BPerlakiH avatar BPerlakiH commented on September 27, 2024 1

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.

from apple.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.