mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-11-25 01:34:51 +01:00
Add a workaround for the start time race condition in Video.js
This commit is contained in:
parent
c5047d8df8
commit
39f68000e3
@ -197,6 +197,8 @@ export function VideoPlayer(props) {
|
|||||||
const paramT = Number(urlParams.get('t'));
|
const paramT = Number(urlParams.get('t'));
|
||||||
const timestamp = !isNaN(paramT) ? paramT : 0;
|
const timestamp = !isNaN(paramT) ? paramT : 0;
|
||||||
player.player.currentTime(timestamp);
|
player.player.currentTime(timestamp);
|
||||||
|
// This is a really hacky way to work around a race condition within Video.js where it thinks it was ready in currentTime() but it actually wasn't so it clears this value:
|
||||||
|
player.player.cache_.initTime = timestamp;
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user