miquael
07-03-2009, 07:21 PM
Hello, I'm a seasoned ActionScript programmer, yet fairly new to Flash video, Flash Media Server, and RTMP.
I've been developing a custom Flash video player, and we now need it to use RTMP with FMS (actually we are using Wowza on www.simpleCDN.com, yet I think it is the same). Despite my attempts, it is not working.
Here is what I have now:
var nc:NetConnection = new NetConnection();
nc.connect("rtmp://e1f1.simplecdn.net/play/");
// alternately, I've tried this too, as SimpleCDN says that you may or may not need "_definst_" depending on the Flash methods:
// nc.connect("rtmp://e1f1.simplecdn.net/play/_definst_/video");
var ns:NetStream = new NetStream(nc);
ns.bufferTime = videoBufferTime;
ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
var meta:Object = new Object();
ns.client = meta;
video.attachNetStream(ns);
var st:SoundTransform = new SoundTransform();
ns.soundTransform = st;
// and then later ...
ns.play("mp4:video/test2.mp4");
I get an error when producing the SWF locally:
ArgumentError: Error #2126: NetConnection object must be connected.
(I did not get this error before when doing a (null) connection, and then calling the entire URL by HTTP method for progressive downloading).
When I run it off my web server, the video player acts as if it is broken (probably from having no connection. I don't think it is a firewall problem, because I am running a test right on the simpleCDN server, and they say it should work fine. It must be this AS code!
I don't get it. Why is a connection not being made?
There is a full thread of this also in Adobe forums:
http://forums.adobe.com/thread/456627?tstart=0
I've been developing a custom Flash video player, and we now need it to use RTMP with FMS (actually we are using Wowza on www.simpleCDN.com, yet I think it is the same). Despite my attempts, it is not working.
Here is what I have now:
var nc:NetConnection = new NetConnection();
nc.connect("rtmp://e1f1.simplecdn.net/play/");
// alternately, I've tried this too, as SimpleCDN says that you may or may not need "_definst_" depending on the Flash methods:
// nc.connect("rtmp://e1f1.simplecdn.net/play/_definst_/video");
var ns:NetStream = new NetStream(nc);
ns.bufferTime = videoBufferTime;
ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
var meta:Object = new Object();
ns.client = meta;
video.attachNetStream(ns);
var st:SoundTransform = new SoundTransform();
ns.soundTransform = st;
// and then later ...
ns.play("mp4:video/test2.mp4");
I get an error when producing the SWF locally:
ArgumentError: Error #2126: NetConnection object must be connected.
(I did not get this error before when doing a (null) connection, and then calling the entire URL by HTTP method for progressive downloading).
When I run it off my web server, the video player acts as if it is broken (probably from having no connection. I don't think it is a firewall problem, because I am running a test right on the simpleCDN server, and they say it should work fine. It must be this AS code!
I don't get it. Why is a connection not being made?
There is a full thread of this also in Adobe forums:
http://forums.adobe.com/thread/456627?tstart=0