React Hook for retrieving playback details for a playback ID.
Player
to fetch the playback URL
for a playback ID.
usePlaybackInfo
hook also supports any
Tanstack Query
useQuery
options, such as refetchInterval
or enabled
. These override any
configs passed by default by the internal hook.
usePlaybackInfo
hook also comes with a
Tanstack Query prefetch query,
prefetchPlaybackInfo
, which makes it easy to prefetch data for server-side
rendering.
First, you add a
getStaticProps
function to the page which you want to prefetch data on. The props should match
the usePlaybackInfo
hook to ensure that the correct data is prefetched.
_app.tsx
to pass the dehydratedState
in pageProps
to
the LivepeerConfig. We also move the livepeerClient
into a useMemo hook so
that a new client is created on each request.
clearClient
boolean which should be used to ensure that the client cache
is not reused across users.