修改 Flipbook jquery 以加快加载速度
我正在使用 Flipbook jquery 插件 和一个大的 png 图像序列。我给插件的创建者发了电子邮件,询问是否有任何方法可以创建某种“加载器”或允许它分块加载并在加载一定数量的图像后开始播放。他的回应如下:
这应该是可能的,我正在考虑这样做,但当时不需要。
在翻书代码中,shouldStartAnimation 函数通过递增计数器并根据总帧数检查该计数器来确定动画是否应开始。当所有帧都已加载后,计时器启动,翻转帧。可以更改此代码,以便计时器在加载一半帧或其他内容后启动。它还可以变得非常奇特,计算出每个帧加载需要多长时间,然后猜测在开始播放序列之前需要加载多少帧,以便在需要时加载所有帧。
不幸的是,我没有时间自己进行这些更改,但请随意根据您的需要修改此代码:)
不幸的是,我不知道足够的 javascript 来完成这项工作,而且我也不知道这对于这样做的人来说到底需要多少工作。我只是希望这里有人可能有一些更有用的信息或建议来帮助我解决这个问题(或者,显然,如果这对某人来说足够容易做到,那就太棒了)。
I am using the Flipbook jquery plugin with a large png image sequence. I emailed the creator of the plugin and asked if there's any way to create some sort of "loader" or allow it to load in chunks and start playing after a certain amount of images are loaded. He responded with the following:
This should be possible and I was thinking of doing this but it wasn't needed at the time.
In the flip book code the shouldStartAnimation function determines if the animation should start by incrementing a counter and checking that counter against the total number of frames. When all the frames have been loaded the timer starts which flips the frames. This code could be changed so the timer starts after half the frames were loaded or something. It could also get really fancy and figure out how long each frame is taking to load and then guess how many frames it needs to let load before it can start playing the sequence so all the frames are loaded by the time it needs them.
Unfortunately I don't have time to make these changes myself, but feel free to modify this code for your needs :)
Unfortunately I don't know enough javascript to get this done, and I don't know exactly how much work this would be for someone who did. I am just hoping someone here might have some more helpful info or advice to help me figure this out (or, obviously, if this is easy enough for someone to just do, that would be amazing).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加一个默认选项,如下所示,确保在正确的位置有正确的“逗号”。
并在以下函数中编辑变量,将变量“end”替换为“loadbeforestart”
,我认为这应该可以解决问题*
Add one more option default, the following, make sure to have proper "comas" in right places.
And edit a variable in the following function, replace variable "end" with "loadbeforestart"
This should do the trick, I think*