use-pip
v1.0.0
Published
A custom react hook for triggering Picture in Picture functionality
Downloads
3
Maintainers
Readme
usePip
A custom React hook to use Picture in Picture mode in supported browsers.
Usage:
const { loading, error, toggle } = usePip(videoRef);
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 |