1.0.0 • Published 5 years ago

use-pip v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

usePip

A custom React hook to use Picture in Picture mode in supported browsers.

Usage:

const { loading, error, toggle } = usePip(videoRef);

Parameters:

Parameterdescriptionrequired?default
videoRefRef for the video elementtruenull

Return:

NameDescriptionType
loadingbooleanManages loading time for setting for detecting support
errorstringError state as described by spec
togglefunctiontoggles state of PiP in document