Xpand
06-17-2009, 12:49 PM
First i use flash media live encoder to creat a stream video with url = "rtmp://localhost/broadcast" and name = "video". Success.
Now I must to display video and audio to screen, my code:
var nc:NetConnection=new NetConnection();
nc.connect("rtmp://localhost/broadcast");
var ns:NetStream=new NetStream(nc);
var vid:Video;
vid = new Video();
vid._x=13.9;vid._y=48;vid._width=198.6,vid._height =148.9;
vid.attachVideo(ns);
ns.play("video");
Result i hear the sound from stream, but cant see video. In as3 i use addChild() to add vid to stage but i dont know way in as2. Please help me, thank you.
Now I must to display video and audio to screen, my code:
var nc:NetConnection=new NetConnection();
nc.connect("rtmp://localhost/broadcast");
var ns:NetStream=new NetStream(nc);
var vid:Video;
vid = new Video();
vid._x=13.9;vid._y=48;vid._width=198.6,vid._height =148.9;
vid.attachVideo(ns);
ns.play("video");
Result i hear the sound from stream, but cant see video. In as3 i use addChild() to add vid to stage but i dont know way in as2. Please help me, thank you.