According to the Flex docs this is possible: "The VideoDisplay control lets you play an FLV file in a Flex application. It supports progressive download over HTTP, streaming from the Flash Media Server, and streaming from a Camera object."
But how do I attach a NetStream (which is playing my live stream) to the component for display? It seems to only have an attachCamera method and a source property, but no attachNetStream method.
It appears that this component manages it's own NetConnection and one has to feed it with a full RTMP string (which can point to a pre-recorded stream or a live stream):
But this a bit sucky for my particular app which consists of a broadcaster and a receiver. Both parts manage their own NetConnection (the text chat I'm using needs an NC regardless of video) and the fact that the VidoDisplay component establishes its own connection results in errors (the NC's callbacks I use elsewhere are not found for the component's connection).
What's also confusing is that on the broadcasting side I can use the component just fine via attachCamera and then a separate attach to the NetStream. So the component works on one end but not the other (if that makes sense). There's probably a way of hacking it so that it can use your own NC but that seems to be overkill here.
But how do I attach a NetStream (which is playing my live stream) to the component for display? It seems to only have an attachCamera method and a source property, but no attachNetStream method.
It appears that this component manages it's own NetConnection and one has to feed it with a full RTMP string (which can point to a pre-recorded stream or a live stream):
viddisp.source = "rtmp://myserver.com/app/live_stream_name";
The syntax above works for me if I have a live stream called 'live_stream_name' playing.But this a bit sucky for my particular app which consists of a broadcaster and a receiver. Both parts manage their own NetConnection (the text chat I'm using needs an NC regardless of video) and the fact that the VidoDisplay component establishes its own connection results in errors (the NC's callbacks I use elsewhere are not found for the component's connection).
What's also confusing is that on the broadcasting side I can use the component just fine via attachCamera and then a separate attach to the NetStream. So the component works on one end but not the other (if that makes sense). There's probably a way of hacking it so that it can use your own NC but that seems to be overkill here.
It would be good if you could pass the component a reference to a playing NS instead of a full RTMP address. For now I'll have to roll back and use a plain Video object to make this work.


a
Here is a code snippet, for attaching a NetStream for rtmp streaming of an FMS or Red5 server. The code was written for a Flex application within the <mx:Script> tag
var vUi:UIComponent = new UIComponent()
var _v0:Video = new Video(640, 360);
vUi.addChild(_v0);
addChild(vUi);
var _s:NetStream = new NetStream(_nc);
_s.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
_s.client = this;
_v0.attachNetStream(_s); _s.play("Transformers");
It works perfectly
_cam = Camera.getCamera();
_cam.setMode(220, 165, 30); _cam.setKeyFrameInterval(60); _cam.setQuality(0,85);
vid.attachCamera(_cam);
The camera captuere
http://www.rockonflash.com/blog/?p=12
Used to be 1 connection could stream 3 streams over that one NC... now if you're using this component!
Looks like I'm going to have to extend and override this thing and hopefully find where they get to the nitty gritty under lying videoPlayer component and pass off the NetConnection object.
::sigh::
I'm publishing a video from my camera from a Red5 server (thanks to the publisher demo) and I don't know which rtmp URI to pass as a source to the videoplayer.
I can get the streaming part to work as I look at the FMS admin console I can see that streams that are created, but I cannot get them to display...
Anyone having any luck.
All, I am trying to do is to publish and stream and view it.
I'm seeing exactly the same problem with Flex 3 and FMS 3.5. Upload from a live camera to server appears to be working fine and event the playback seems to work, at least I get the right sequence of events, see the number of upload/download bytes incrementing in the admin console..
But then my playback VideoDisplay simply freezes at the very first frame and that's about it. No playback for live streams.
Did you manage to figure out what's wrong?
Can u help me?
Let's say u have VideoDisplay, Button1, Button2. VideoDisplay doesn't have any source. When u click on the Button1 or Button2 the VideoDisplay recieve an URL to the file1 (by button1) or file2(by button2) and start playin' the video.
mic = Microphone.getMicrophone();
mic.addEventListener(StatusEvent.STATUS, this.onInputStatus);
camera = Camera.getCamera();
camera.addEventListener(StatusEvent.STATUS, this.onInputStatus);
mic.setUseEchoSuppression(true);
mic.setSilenceLevel(0, 2000);
mic.rate = 11;
camera.setKeyFrameInterval(15);
camera.setMode(240,180,15,false);
camera.setMotionLevel(35,3000);
camera.setQuality(40000/8,0);
videoS2 = new Video(179, 179);
videoCanvas.rawChildren.addChild(videoS2);
videoS2.x = 0;
videoS2.y = 200;
videoCanvas.invalidateDisplayList();
videoDisplay1.attachCamera(camera);
outstream = new NetStream(nc);
outstream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
instream = new NetStream(nc);
instream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
outstream.attachAudio(mic);
outstream.attachCamera(camera);
outstream.publish("uid" + appUserDetailsID);
videoS2.attachNetStream(instream);
instream.play("uid" + userSelect[0]);
AND it works! BUT the videoS2 display which shows the in video stream is only some 4 pixels square - why when it is set to 179 square? ANY help suggestions would be much appreciated!!
videoS2.height = 179;
videoS2.width = 179;
VOD seems so easy - get a NetConnection, pass it to your NetStream instance, attach the NetStream, play it, and attach it to your Video object. Seems to be no simple way, though, to tell the process that this is "live".
I've got 6 players now on my machine that will play a live stream. Not a one of them will let me at the NetConnection object to add the parameters my CDN needs. They just don't seem to expose it. I must be missing something simple.
I'll look forward to your post. If I figure out a solution I'll post as well.
http://www.flashcomguru.com/index.cfm/2009/8/14/fl...