View Full Version : Loop FLV Component
adrian7474
June 26th, 2009, 01:53 PM
I have a flv component on my stage and i have buttons load different flvs into that component. However, I need to have it loop when its over.
How do I do this??
fizheye
June 26th, 2009, 05:36 PM
I have a flv component on my stage and i have buttons load different flvs into that component. However, I need to have it loop when its over.
How do I do this??
This is how I do it, hope it help.
// ActionScript 3.0
var video:Video = new Video();
addChild(video);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = {onMetaData:ns_onMetaData};
video.attachNetStream(ns);
ns.play("video.flv");
//This you can set the FLV to the center of your stage
function ns_onMetaData(item:Object):void {
video.width = item.width;
video.height = item.height;
video.x = (stage.stageWidth - video.width) / 2;
video.y = (stage.stageHeight - video.height) / 2;
}
//Loop the FLV
ns.addEventListener(NetStatusEvent.NET_STATUS, NCListener);
function NCListener(e:NetStatusEvent){
if (e.info.code == "NetStream.Buffer.Empty") {
ns.play("video.flv");
}
};
999
June 27th, 2009, 02:06 AM
FLVPlayback.addEventListener(VideoEvent.COMPLETE, replayVideo);
function replayVideo(e:VideoEvent) {
FLVPlayback.seek(0);
FLVPlayback.play();
}
Shirley1874
June 29th, 2009, 06:12 AM
You could check these tutorials, the first one is very simple, and the second one requires actionscript. Hope them helps -
http://flash-video-player.blogspot.com/2009/03/how-to-make-video-auto-play-on-web-page.html
http://www.wildform.com/support/tutorials/loopingFLVs/
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.