classtranscribe / FrontEnd

The React + Redux Frontend for ClassTranscribe
https://classtranscribe.illinois.edu
Other
26 stars 28 forks source link

Set initial speed for 2nd video stream #617

Closed angrave closed 10 months ago

angrave commented 1 year ago

If you are watching a video at a different speed than 1x, and then refresh the video, one of the screencasts will go back to 1x while the other will stay at the original speed, resulting in a mismatch of the content that is being shown and heard. If you switch the speed setting back to 1x and then back to the original speed (other than 1x) after refreshing it will go back to working as intended as far as I can tell.

angrave commented 1 year ago

https://github.com/classtranscribe/FrontEnd/blob/staging/src/screens/Watch/Components/CTPlayer/index.js

(was able to reproduced bug on 2stream CS341 lecture video). Here is where the playbackrate is update on both video components- https://github.com/classtranscribe/FrontEnd/blob/staging/src/screens/Watch/Components/CTPlayer/index.js#L41 I wonder why during (re-)initialization only one video is set?

Anxin23 commented 1 year ago

Unpredictable video behaviour upon refresh

l have notice an additional issues that may be related to the original bug. Specifically, when a vedio is refreshed, the playback speed on the first screen may inconsistently reset to 1x or maintain its original speed before the refresh.

This behavior is not only limited to the dual screen mode and can be replicated in single screen mode as well, as observed in the CS341 class videos. The issues is erratic and not always reproducible, as there are instances when a video set at 2x speed maintains its speed post-refresh, while at other times, it resets to 1x.

ln light of these observations, it appears this issue might not be tied to the dual screen model, but rather associated with how video component states are retained and retrieved after a refresh.

Anxin23 commented 1 year ago

l put the record here issue record.mp4.zip

angrave commented 11 months ago

Could this be a race condition? e.g. setting the speed on the actual html5 component (not the react component) before the video is loaded and ready to start Race condition confirmed :Demo here. Short version; if you set the playbackRate before setting (or resetting) the src attribute then the playbackRate is reset back to 1 when src is set. https://jsfiddle.net/langrave/c89Lgxqt/36/