How can I subscribe to the current seek time? #1263
Unanswered
TasseDeCafe
asked this question in
Q&A
Replies: 1 comment
-
I've looked into the examples, and one way I could see this being done is by using this previewTime number in the radix+tailwind example: export function Time({ thumbnails }: TimeSliderProps) {
const time = useMediaState('currentTime'), canSeek = useMediaState('canSeek'), duration = useMediaState('duration'), seeking = useMediaState('seeking'), remote = useMediaRemote(), step = (1 / duration) * 100, [value, setValue] = useState(0), { previewRootRef, previewRef, previewValue } = useSliderPreview({
clamp: true,
offset: 6,
orientation: 'horizontal',
}), previewTime = (previewValue / 100) * duration; but maybe there is a more direct way to subscribe to this value. I'm using the default audio layout. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I understand how to access the current time being played like this:
const currentTime: number = useMediaState('currentTime', player)
However, I don't understand how to access the current time being seeked in the time slider. currentTime will give you the time currently being played, not the time being seeked. There doesn't seem to be a prop in the player to access this data.
Can this information be subscribed to in some other way?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions