The ClipTrigger
component enables users to create clips from live Player content.
ClipTrigger
is designed to be used as a child of the Player
component.
It interacts with the playback state to provide a user-friendly interface for creating media
clips, based on the Unix timestamp from the current playback position.Clipping is currently supported only for livestreams.ClipTrigger
will automatically handle determining the Unix timestamp for the
current playback position. The playback position is not the same as the
server livestream head, due to natural latency from server ingest to playback.
This is why Unix timestamps are required, and relative timestamps cannot be
used.ClipTrigger
is a button that users can interact with to initiate the clip
creation process. It’s displayed only if clipping functionality is enabled (by
passing a valid clipLength
to the Root component).
It should be wrapped in a LiveIndicator, since the “last n seconds” clipping
functionality is only supported on livestreams.
forceMount
onClip
playbackId
, startTime
, and endTime
, which can be used to
handle the clip creation process.
ClipTrigger
component assigns data attributes to its underlying element to
reflect the current state and user interaction capabilities.
data-livepeer-controls-clip-button
data-visible
"true"
meaning it’s
currently visible (i.e., clip functionality is enabled) and "false"
denoting
it’s not visible, useful for CSS-based animations.