Improve Recordings loading (#10462)

* Show skeleton until video players finishes loading

* Clean up android logic

* Ensure mobile view video is consistent

* Cleanup

* Only show when not scrubbing

* Don't use loading

* Start preview at correct time too

* Fix react race condition

* Be wait for seek to show video player
This commit is contained in:
Nicolas Mowen
2024-03-15 07:52:38 -05:00
committed by GitHub
parent d882cb0f63
commit c66f552280
5 changed files with 63 additions and 18 deletions
@@ -81,13 +81,27 @@ export class DynamicVideoController {
this.playerController.currentTime = seekSeconds;
if (play) {
this.playerController.play();
this.waitAndPlay();
} else {
this.playerController.pause();
}
}
}
waitAndPlay() {
return new Promise((resolve) => {
const onSeekedHandler = () => {
this.playerController.removeEventListener("seeked", onSeekedHandler);
this.playerController.play();
resolve(undefined);
};
this.playerController.addEventListener("seeked", onSeekedHandler, {
once: true,
});
});
}
seekToTimelineItem(timeline: Timeline) {
this.playerController.pause();
this.seekToTimestamp(timeline.timestamp + this.annotationOffset);