Play a rtmp stream from Flash Media Server

By allanbj | Jan 14, 2009

actionscript3

I want to make a small simple flash file that automatically begins playing a live stream from Flash Media Server. I have the following code, but it plays a prerecorded FLV file on the server. But I want to play a stream instead…

ActionScript Code:
var vid:Video = new Video(50, 38); addChild(vid); var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); vid.attachNetStream(ns); var listener:Object = new Object(); listener.onMetaData = function(evt:Object):void {}; ns.client = listener; ns.play(“externalVideo.flv”);

I figured out I needed to change this line:

ActionScript Code:
nc.connect(“rtmp://mystreamserver.com/live/livestream.flv”);

- but what else do I need to do?

Also, I do not want the sound to be heard. How would I do that?

actionscript3

Please reply at our Forum

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© 2007 ActionScript 3.0