Closed MattiasBuelens closed 7 months ago
This adds hooks such as useCurrentTime(), usePaused() and useVolume(), to easily access the player's state from within a custom React component.
useCurrentTime()
usePaused()
useVolume()
I also reworked our internals to avoid useEffect() as much as possible, using the techniques from You Might Not Need an Effect.
useEffect()
useSyncExternalStore
usePlayer()
setUi
This adds hooks such as
useCurrentTime()
,usePaused()
anduseVolume()
, to easily access the player's state from within a custom React component.I also reworked our internals to avoid
useEffect()
as much as possible, using the techniques from You Might Not Need an Effect.useSyncExternalStore
.usePlayer()
now accepts the UI element as a prop, rather than returning asetUi
callback.