-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support advanced PiP integration #612
Comments
I finally could understand why sometimes we observed Picture in Picture being paused during restoration, not from the PiP overlay itself, but by starting playback of another content. This investigation and the related fix were made as part of #702. When do pauses occur?Pauses occur when transitioning via PiP from some content A, played with a player supporting PiP, to some content B, played in the same player but not supporting PiP. Compare:
In the first case playback continues, while in the second one playback is paused. RemarkYou might think that this case is convoluted but actually it isn't. The fact that a view supports PiP not only supposes that the video view has been configured appropriately, but also that the view itself is installed in the hierarchy and therefore could register itself with a Picture in Picture controller. Depending on how a player user interface is implemented the view might not be immediately available, e.g. if the implementation only displays the video view once the media type is known (see #696 for a related issue that needed to be fixed as well). This is perfectly legitimate and can happen in practice. We have no way of preventing such implementations and we cannot have behaviors break just because of subtle layout implementation refactorings that are part of any development process. Why do pauses occur when transitioning to a layout not-supporting PiP?Our implementation explicitly stops Picture in Picture using the dedicated API when a video view appears for the first time (via
We can easily understand what happens now:
How can we fix this issue?To fix the issue visible in the second scenario we need to detach the player from the PiP layer before PiP is stopped, but only when the view we are transitioning to does not support PiP anymore. This way we avoid the player being shared and pausing playback in the other layer when PiP is closed: PIP_detach.movThe programmatic PiP stop is not even needed in this case since this change forces PiP to close automatically. The stop is still needed for the first scenario, though, so that the PiP overlay is properly returned when transitioning to the same view supporting PiP. |
Here are a few use cases as a reminder of expected behaviors that should possible to implement and test in the demo. This is of course no perfect replacement for proper unit testing but at least better than having nothing. In all cases:
Note that the behaviors listed above are mostly a matter of proper route management. Our API, though, must have the flexibility so that these behaviors can be implemented. Restoration with PiP overlay restoration buttonrestoration.movRemarkPiP must be possible simultaneously with other views backed by separate models. Restoration must also be possible. restoration-replacement.movRestoration by opening the same content with the same modelrestoration-to-same.movRestoration by opening another content with the same modelrestoration-to-other.movRemarkIf going through several contents played with the same model / player, the latest content must be restored (in the video below Couleur 3 is restored, not the first opened SWI content): restoration-to-latest.movRestoration by opening another 360° content with the same modelMonoscopic display does not support PiP. restoration-to-360.movRestoration by opening another failing content with the same modelrestoration-to-failure.movRestoration to another view model with PiP-supporting
|
As a developer integrating Pillarbox I want to be able to implement PiP deeper in my application, so that users can browse the application while continuing playback using PiP.
As a Pillarbox user I want to be able to use the app while watching content.
Acceptance criteria
Hints
SystemVideoView
#610 should be provided.Tasks
The text was updated successfully, but these errors were encountered: