Rendering a chain of images like a video in javascript

后端 未结 4 1284
清歌不尽
清歌不尽 2021-01-02 00:10

I\'m trying to synthesize a video using a stream of images in JavaScript. The problem is the \"video\" is either jerky, which was solved by using a buffer of sorts. However

4条回答
  •  失恋的感觉
    2021-01-02 00:45

    Instead of loading images as often as possible, you can use the window.setInterval method to make a function run at a set interval, for example ten times a second.

    You can start loading the next image as soon as you have displayed an image, but instead of having the load event showing it, you can let the function that is running at an interval do that.

提交回复
热议问题