You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The calculation of the number of frames for dom videos is based on a hard coded frame rate (see domReader.js#L133). This leads to the generation of images larger that necessary.
A first improvement would be to not store all frames but check the video.currentTime to see if it is close to the seeked one. Something like a if (Math.abs(nextTime - video.currentTime) < 1e-8).
video.addEventListener('ended',function(){onload({source: origin});onloadend({source: origin});});varframeCb=function(/*now, metadata*/){// repeatvideo.requestVideoFrameCallback(frameCb);// store// warn: if placed before the frame request, will// skip the second frame, I guess because of the call// to context.draw...storeFrame();};video.requestVideoFrameCallback(frameCb);video.loop=false;video.autoplay=false;video.muted=true;video.currentTime=0;video.play();
Both solution need to rethink how the number of frames is passed to the app.
The text was updated successfully, but these errors were encountered:
listen to timeupdate: ~1/2 frames... some posts say that firefox fires timeupdate at frame change, not in my case (firefox 85)... (https://stackoverflow.com/a/17048103)
The calculation of the number of frames for dom videos is based on a hard coded frame rate (see domReader.js#L133). This leads to the generation of images larger that necessary.
A first improvement would be to not store all frames but check the
video.currentTime
to see if it is close to the seeked one. Something like aif (Math.abs(nextTime - video.currentTime) < 1e-8)
.Another one would be to use the `` (see video-rvfc draft and video-rvfc repo). For now it is only supported on chrome based browser: caniuse requestvideoframecallback). The code would look like:
Both solution need to rethink how the number of frames is passed to the app.
The text was updated successfully, but these errors were encountered: