Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OpenCut-app/OpenCut/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The PlaybackManager controls video playback state, seeking, volume, and scrubbing. Access it througheditor.playback.
Usage
Basic playback control
Seeking to a specific time
Volume control
Methods
play()
Starts video playback. If playback has reached the end, it automatically seeks to the beginning.pause()
Pauses video playback.toggle()
Toggles between play and pause states.seek()
Seeks to a specific time in seconds. The time is automatically clamped between 0 and the total duration.The time to seek to in seconds
Seeking dispatches a
playback-seek custom event on the window object.setVolume()
Sets the playback volume. Automatically unmutes if volume is greater than 0.Volume level from 0.0 (silent) to 1.0 (full volume)
mute()
Mutes audio playback while preserving the previous volume level.unmute()
Restores audio to the previous volume level before muting.toggleMute()
Toggles between muted and unmuted states.setScrubbing()
Sets the scrubbing state. Used to indicate when the user is dragging the playhead.Whether the user is currently scrubbing
getIsPlaying()
Returns whether video is currently playing.boolean- True if video is playing
getCurrentTime()
Returns the current playback time in seconds.number- Current time in seconds
getVolume()
Returns the current volume level.number- Volume level from 0.0 to 1.0
isMuted()
Returns whether audio is currently muted.boolean- True if audio is muted
getIsScrubbing()
Returns whether the user is currently scrubbing.boolean- True if scrubbing
subscribe()
Subscribes to playback state changes.Function called when playback state changes
() => void- Unsubscribe function
The
useEditor() hook automatically subscribes to all manager changes. Only use subscribe() directly in non-React code.