diff --git a/src/dom/bufferToVideo.ts b/src/dom/bufferToVideo.ts index fcd2063..6e0a6ee 100644 --- a/src/dom/bufferToVideo.ts +++ b/src/dom/bufferToVideo.ts @@ -5,9 +5,7 @@ export function bufferToVideo(buf: Blob): Promise { if (!(buf instanceof Blob)) reject(new Error('bufferToVideo - expected buf to be of type: Blob')); const video = env.getEnv().createVideoElement(); - video.onloadstart = () => { - setTimeout(() => resolve(video), 100); - }; + video.oncanplay = () => resolve(video); video.onerror = reject; video.type = buf.type; video.playsInline = true;