在 Actionscript 3 中预加载 FLV?
我正在开发一个 Flash 网站,其中包含大量基于视频的部分到部分的转换。 过渡视频本身只有几秒钟长,但由于分辨率非常高,因此相当大(~700kb); 考虑到部分的数量和部分到部分的转换组合(以及视频),在初始站点加载时预加载所有转换是不可行的。
我想做的是根据需要快速加载每个过渡视频; 例如,如果您位于 A 区域并单击 B 区域的导航,则会加载 A->B 视频(大多数用户只需等待几秒钟),然后进行播放。 然而,我还希望在播放之前在过渡加载时显示一个快速加载器图形(像加载栏这样简单的东西,但不仅仅是一个旋转器等,因为明确的进度感很重要)。
在 Actionscript 3 中执行此操作的最佳方法是什么? 在 AS2 中相对简单(http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001036.html)但是我还没有看到针对 AS3 的简单解决方案。 我使用基于标准代码的技术在 AS3 中进行 FLV 播放(NetConnection、NetStream、视频对象)——没有 FLVPlaybackComponents 或类似技术。
多谢!
I'm working on a flash site with lots of video-based section-to-section transitions. The transition videos themselves are only a few seconds long but are fairly weighty (~700kb) as they're very high-resolution; given the number of sections and section-to-section transition combinations (and therefore videos), preloading all of the transitions on initial site load isn't feasible.
What I'd like to do is have a quick load of each transition video on an as-needed basis; e.g., if you're in area A and click navigation for area B, the A->B video loads (only a few seconds' wait for most users) and is then played back. However, I'd also like a quick loader graphic displayed as the transition loads, before it gets played back (something simple like a loadbar, but more than just a spinner or the like, as the sense of definite progress is important).
What's the best way to do this in Actionscript 3? It was relatively straightforward in AS2 (http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001036.html) but I've yet to see an simple solution for AS3. I'm using standard code-based techniques for FLV playback in AS3 (NetConnection, NetStream, Video objects)--no FLVPlaybackComponents or similar.
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
AS3 中没有太大区别。 只需使用计时器而不是间隔即可。 您将该代码转换为 AS3 时遇到问题吗?
It's not much different in AS3. Just use a Timer instead of an interval. Were you having problems converting that code to AS3?
Adobe 网站上的示例仍然有效,只需添加以下内容:
That example on Adobe's website still works, just prepend: