I am trying to figure out how to use netstream to play an FLV. Does anyone know of any examples or samples of how to do this?
I am playing the FLV from a different server that does not have an direct internet access. I access it by IP address. rmtp://xxx.xxx.xxx.xxx/VOD/myFLV. Please help?
Ok I have some code but all I get is a blank screen when I test this so I am wondering if I have an erorr. Does anyone see a problem with this? Thanks.
// AS3
var customClient:Object = new Object();
customClient.onCuePoint = cuePointHandler;
customClient.onMetaData = metaDataHandler;
var myVideo:Video = new Video();
addChild(myVideo);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = customClient;
myVideo.attachNetStream(ns);
ns.play("rmtp://xxx.xxx.xxx.xxx/folder/Arrival.flv");
ns.addEventListener(NetStatusEvent.NET_STATUS, ns_onPlayStatus);
function ns_onPlayStatus(event:NetStatusEvent):void
{
trace("Movie Playing");
}
function cuePointHandler(infoObject:Object):void
{
trace("cuePoint");
}
function metaDataHandler(infoObject:Object):void
{
trace("metaData");
myVideo.width = 480;// Resize video instance.
myVideo.height = 360;
myVideo.x = (stage.stageWidth - myVideo.width) / 2;// Center video instance on Stage.
myVideo.y = (stage.stageHeight - myVideo.height) / 2;
}
North America
Europe, Middle East and Africa
Asia Pacific