forked from mystiq/hydrogen-web
safari hack/fix
This commit is contained in:
parent
948249bb3d
commit
e8c8455f43
1 changed files with 3 additions and 0 deletions
|
@ -124,6 +124,9 @@ async function loadVideoFromBlob(blob) {
|
||||||
// seek to the first 1/10s to make sure that drawing the video
|
// seek to the first 1/10s to make sure that drawing the video
|
||||||
// on a canvas won't give a blank image
|
// on a canvas won't give a blank image
|
||||||
const seekPromise = domEventAsPromise(video, "seeked");
|
const seekPromise = domEventAsPromise(video, "seeked");
|
||||||
|
// needed for safari to reliably fire the seeked event,
|
||||||
|
// somewhat hacky but using raf for example didn't do the trick
|
||||||
|
await new Promise(r => setTimeout(r, 200));
|
||||||
video.currentTime = 0.1;
|
video.currentTime = 0.1;
|
||||||
await seekPromise;
|
await seekPromise;
|
||||||
return video;
|
return video;
|
||||||
|
|
Loading…
Reference in a new issue