Get autoplay working right

This commit is contained in:
Nicolas Mowen 2024-03-08 15:48:11 -07:00
parent c4a6c31fe3
commit 431774d044
2 changed files with 6 additions and 0 deletions

View File

@ -328,6 +328,10 @@ export class DynamicVideoController {
}
}
autoPlay(play: boolean) {
this.playerController.autoplay(play);
}
seekToTimestamp(time: number, play: boolean = false) {
if (this.playerMode != "playback") {
this.playerMode = "playback";

View File

@ -119,7 +119,9 @@ export function DesktopRecordingView({
const newController = videoPlayersRef.current[newCam];
lastController.onPlayerTimeUpdate(null);
lastController.onClipChangedEvent(null);
lastController.autoPlay(false);
lastController.scrubToTimestamp(currentTime);
newController.autoPlay(true);
newController.onCanPlay(() => {
newController.seekToTimestamp(currentTime, true);
newController.onCanPlay(null);