w3c / picture-in-picture

Picture-in-Picture (PiP)
https://w3c.github.io/picture-in-picture
Other
309 stars 38 forks source link

Provide a clear definition of when a UA should display controls in a PiP window #119

Closed scottlow closed 5 years ago

scottlow commented 5 years ago

The spec today states the following with respect to a UA displaying controls that map to MediaSession actions:

The API will have to be used with the MediaSession API for customizing the available controls on the Picture-in-Picture window.

... the user agent MAY expose Picture-in-Picture window controls that change video playback state (e.g., pause).

It makes sense for a play/pause control to be continually shown in a PiP window, however, for the remaining actions (seekbackward, seekforward, previoustrack, nexttrack, and skipad), it seems like there would be value in specifying that UAs which choose to display controls should either hide or disable UI elements that map to actions that do not have a MediaSessionActionHandler associated with them.

beaufortfrancois commented 5 years ago

It will be hard to add web platform tests for those but I'd be happy to reconsider defining whether controls should be displayed in the PiP window in this spec.

Note that in Chrome for instance, we have special rules for the play/pause button. If video is a mediastream or has infinite duration, we don't show it by default unless MediaSession actions are set for "play" and "pause". Moreover, we currently show next and previous tracks when MediaSession actions are set for "nexttrack" and "previoustrack" but other user agents may want to always show them in a disabled state.

WDYT @mounirlamouri @jernoble

scottlow commented 5 years ago

Per discussion at TPAC 2019, we agreed that this behavior should be left up to the UA.