[Red5] Display live Video Red5

Tyler Kocheran rfkrocktk at gmail.com
Tue May 26 13:56:45 PDT 2009


Use a flash.net.NetConnection to connect to Red5. After it's connected,
create a flash.net.NetStream using the NetConnection. Call
NetStream.play("myStream") substituting "myStream" for the stream name you
want to play. Then, create a flash.media.Video object, and then call
Video.attachNetStream(myNetStream).

On Tue, May 26, 2009 at 1:25 PM, Denis Zgonjanin <me.snap at gmail.com> wrote:

> I don't know what you're missing, but try this:
>
> The Connection class, I don't remember where exactely I found it, but it
> can be found here as well:
>
> https://svn.jivesoftware.com/svn/dev/repos/jive/clearspace/videopost/Red5%20Recorder/org/red5/as3/net/Connection.as
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="absolute" creationComplete="onCreationComplete()">
>     <mx:Script>
>         <![CDATA[
>             import mx.core.UIComponent;
>             import org.red5.as3.net.Connection;
>
>             private var conn:Connection;
>             private var nc:NetConnection;
>             private var videoHolder:UIComponent = new UIComponent();
>             private var videoPlayer:Video;
>
>             private function onCreationComplete():void{
>                 conn = new Connection();
>                 conn.setURI("rtmp://localhost/oflaDemo");
>                 conn.connect();
>                 nc = conn.getConnection();
>                 videoPlayer = new Video(800, 600);
>                 videoHolder.setActualSize(800, 600);
>                 videoHolder.addChild(videoPlayer);
>                 canvas.addChild(videoHolder); //This is just a canvas in
> the mainapp.mxml
>                 videoHolder.x = 0;
>                 videoHolder.y = 0;
>             }
>
>             private function startViewing():void{
>                 var ns:NetStream = new NetStream(nc);
>                 ns.client = this;
>                 ns.bufferTime = 0;
>                 ns.receiveVideo(true);
>                 ns.receiveAudio(false);
>                 videoPlayer.attachNetStream(ns);
>                 ns.play(TheNameOfYourRed5Stream);
>             }
>         ]]>
>     </mx:Script>
>
>     <mx:Canvas id="canvas" />
>     <mx:Button id="startVideo" click="startViewing()" label="start video"
> />
> </mx:Application>
>
>
>
> On Tue, May 26, 2009 at 3:29 PM, Yann JAMAR <yann.jamar at paquetbtp.fr>wrote:
>
>>  Same trouble for me :)
>>
>> ----- Original Message -----
>>  *From:* Miguel Barros <barrosgmr at gmail.com>
>> *To:* red5 at osflash.org
>> *Sent:* Tuesday, May 26, 2009 9:04 PM
>> *Subject:* [Red5] Display live Video Red5
>>
>> Hi!
>>
>> Maybe this is not the right place to ask this.... but i appreciate if some
>> one can help me. So, thank you very much, in advance.
>>
>> I'm Streaming Live Video from Red5 to a Flash interface.
>>
>> My doubt is how to display the video.
>>
>> I have a VideoDisplay in my Flex / ActionScript code.
>>
>> I look around different aways:
>>
>> 1)This way:
>> var myVideo:Video = new Video(176,144);
>>
>>  incomingNetStream = new NetStream(netConnection);
>>  incomingNetStream.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
>>  incomingNetStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR,
>> asyncErrorHandler);
>>
>>  myVideo.attachNetStream(incomingNetStream);
>>  incomingNetStream.play(playName);
>>
>>  videoReceive.addChild(myVideo);
>>
>>  ..........
>>
>> <mx:VideoDisplay x="10" y="233" width="176" height="144" id="videoReceive"
>> />
>>
>> 2) Or more simple:
>>
>> videoReceive.source = "rtmp://myserver.com/app/live_stream_name";
>>
>> Anyone try this?
>>
>> Thank you very much for the answers.
>>
>> Best Regards,
>>
>> M. Barros
>>
>>
>>  ------------------------------
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>
>
> --
> Denis Zgonjanin
> Blindside Networks
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>


-- 
And do this, knowing the time, that now it is high time to awake out of
sleep;
for now our salvation is nearer than when we first believed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090526/a88eae72/attachment.html>


More information about the Red5 mailing list