mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
safari hack/fix
This commit is contained in:
parent
948249bb3d
commit
e8c8455f43
@ -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 New Issue
Block a user