2007年12月25日 星期二

Create own video player

自家製影片播放器 (Advanced Flash)








Demo : http://annwongfresh.googlepages.com/ownVideoPlayer.html
Souce code : http://annwongfresh.googlepages.com/ownVideoPlayer.fla
Testing Material : http://annwongfresh.googlepages.com/testvideo8.flv


Actionscript :

stop();
var connect_nc:NetConnection = new NetConnection();

connect_nc.connect(null);

var stream_ns:NetStream = new NetStream(connect_nc);
myVideo.attachVideo(stream_ns);stream_ns.play("XXXXXx.flv"); // FILL YOUR VIDEO NAME

stream_ns.onStatus = function(infoObject:Object)
{ if (infoObject.code == "NetStream.Play.StreamNotFound")
{ trace("Could not find video file."); }}

pausebtn.onRelease = function(){ stream_ns.pause(true);}
playbtn.onRelease = function(){ stream_ns.pause(false); }




1 Comment:

OdiaPortal Lab said...

hello, nice tutorial. but i want to know- i have a video at a site. but i want to play that at another website. how is this possible... please replay quickly.