开发者

Stream an FLVPlayback through the internet

I have a video in flash in the size of 19 MB (5 minutes) and I want the user to see what that has been开发者_开发问答 loaded so far, or even get an indication of what has been loaded - so he won't be stuck in a blank screen until the video loads.

The quality of the video is important so I won't resize it - but how can I:

  1. stream it so the user can see what that has been loaded so far
  2. give him an indication of how long he will need to wait until it loads.

My code looks something like this:

import fl.video.*;

var video = new FLVPlayback();
video.fullScreenTakeOver = false;
video.source = "MansfredLoop.f4v";
stage.addChild(video);

Where do I start?


import fl.video.*;

var totalBytes:int;

var loadedBytes:int;

var remainingBytes:int;

var myTimer:Timer = new Timer(100);

var video = new FLVPlayback();
video.fullScreenTakeOver = false;
video.source = "MansfredLoop.f4v";
stage.addChild(video);

myTimer.addEventListener("timer", timerHandler);
myTimer.start();

totalBytes = video.bytesLoaded;

function timerHandler(event:TimerEvent):void {

    loadedBytes = video.bytesLoaded;
    remainingBytes = totalBytes - loadedBytes;
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜