event listener says NetStream.Play.Start but I see no video

Posted by Curtis on Stack Overflow See other posts from Stack Overflow or by Curtis
Published on 2013-07-02T22:19:55Z Indexed on 2013/07/02 23:05 UTC
Read the original article Hit count: 216

I'm trying to test out the Adobe Media Server, and I'm following some tutorials in order to stream a video.

I have a NetConnection which successfully connects to the application on the server, then I have the code below.

It looks like it's supposed to play a video, but it doesn't. It creates the video object as a black square in the top left corner, and the event.info.code says NetStream.Play.Start, but I don't see the video playing.

case "NetConnection.Connect.Success": 
                var v:Video = new Video();
                v.width=200;
                v.height=200;
                v.x=0;
                v.y=0;
                v.visible=true;
                v.opaqueBackground=false;
                stage.addChild(v);
                var ns:NetStream = new NetStream(nc);
                ns.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);
                v.attachNetStream(ns);
                ns.play("mp4:polymorphics.f4v");

I can also try ns.play("rtmp://localhost/vod/mp4:tests/polymorphics.f4v");

but that gives me a Stream Not Found error


The lines that begin with "ns" means that they're generated by my NetStream listener, as opposed to my NetConnection listener.

Connecting...
connected is: true
event.info.level: status
event.info.code: NetConnection.Connect.Success
onReply recieved value: Hello, World!
ns connected is: true
ns event.info.level: status
ns event.info.code: NetStream.Play.Reset
ns connected is: true
ns event.info.level: status
ns event.info.code: NetStream.Play.Start

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about flash