feat: resume playback on the clip after we left off
This commit is contained in:
@@ -163,13 +163,16 @@ export function useStreamPlayback(
|
|||||||
|
|
||||||
// Try to find the marker's target particle
|
// Try to find the marker's target particle
|
||||||
const found = children.find(
|
const found = children.find(
|
||||||
(c) => c.created_at.getTime() === playbackPosition.getTime(),
|
(c) => c.created_at.getTime() > playbackPosition.getTime(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (found) {
|
if (found) {
|
||||||
initializedForRef.current = streamParticle.id;
|
initializedForRef.current = streamParticle.id;
|
||||||
dispatch({ type: "INIT", particleId: found.id });
|
dispatch({ type: "INIT", particleId: found.id });
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
initializedForRef.current = streamParticle.id;
|
||||||
|
dispatch({ type: "INIT", particleId: children[children.length - 1].id });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Marker target not found yet — fall back after timeout
|
// Marker target not found yet — fall back after timeout
|
||||||
|
|||||||
Reference in New Issue
Block a user