开发者

How do I smoothly play FLV video while loading assets in the background?

Working on a 'video heavy' Flash site that has an intro video. While the intro video is playing, assets(images,flv files) should be loaded in the background. The problem is that, while the assets are loading, the intro video play gets jittery.

What can I do to make the video playing smoothly while still loading assets?

It might be the single threaded nature of actionscript, not sure. Any suggestion would help.

After using @Demian Brecht suggested method, I noticed that the culprit might be Memory allocation. As the FLVs load the memory usa开发者_如何学Goge goes up by ~266MB and while the videos are written to memory, the framerate drops to 1FPS.

I imagine I could first load all the videos and after they're in memory could display the intro video, but ideally I would need some sort of workaround to load the rest of the videos while the intro is playing.

Hints ?


AFAIK, there's no "nice" way to deal with your problem nicely due, as you mentioned, to the single threaded nature of ActionScript.

I'd maybe move your video to begin playing in a post asset loading state and rely on a good old progress bar while loading.

A purely theoretical thought...

What if you had two embedded swf's on a page, one hidden and one playing the intro movie? Through javascript/flash interop, you could conceivably kick off loading the assets in your hidden swf once the intro video starts (as well as retrieve status updates).

Of course, you couldn't access the movies directly from the visible swf, but once loading is done, the movies should be cached by the browser and should be available immediately upon request...

Again, just a thought - haven't actually tried anything like that myself.


Have you tried increasing the bufferTime or do you think that the loading is limiting system resources?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜