Features
- Automatic conditional rendering based on browser API availability,
customizable with the
matcherpattern - Supports both the w3c standard (which most modern browsers support), as well as the older Safari/iOS spec (see the browsers which support Picture-in-Picture on caniuse)
Anatomy
Import the components and piece the parts together.Props
The component accepts all props suitable for a button element.Data Attributes
data-livepeer-controls-picture-in-picture-trigger
Serves to identify the component’s role.
data-picture-in-picture
Indicates the current picture-in-picture state, "true" when the feature is
active and "false" otherwise.
data-visible
Reflects the visibility status of the trigger, with "true" meaning it’s
currently visible (i.e., picture-in-picture is supported and the media is not in
fullscreen mode) and "false" denoting it’s not visible.
This is often used for dynamically applying enter/exit CSS animations.