usePip
A custom React hook to use Picture in Picture mode in supported browsers.
Usage:
const loading error toggle = ;
Parameters:
Parameter | description | required? | default |
---|---|---|---|
videoRef | Ref for the video element | true | null |
Return:
Name | Description | Type |
---|---|---|
loading | boolean | Manages loading time for setting for detecting support |
error | string | Error state as described by spec |
toggle | function | toggles state of PiP in document |