Hi,
Im just starting out and Im feeling really dumb because I’m having trouble getting really simple examples to work.
Im trying to make a flex version of the simple video stream that opens when wowza starts. Im using the code from page 46 of the user guide.
There are lots of examples, and they look great, but they are all .fla files which I cant open in flash builder.
Here is my mxml file that Im using at the moment, which is the best I have been able to do, I am getting sound out of this but video is black.
Any help would be really appreciated, I think I just need something really simple that I can play around with to get started.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
initialize="init()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
private var myCam:Camera;
//private var camVideo:Video;
private var wowzaVideo:Video;
private var nc:NetConnection = new NetConnection();
private var ns:NetStream = null;
private function init():void
{
nc.addEventListener(NetStatusEvent.NET_STATUS, ncOnStatus);
nc.connect("rtmp://localhost/vod");
myCam = Camera.getCamera();
camVideoDisplay.attachCamera(myCam);
}
private function ncOnStatus(infoObject:NetStatusEvent):void
{
if (infoObject.info.code == "NetConnection.Connect.Success")
{
ns = new NetStream(nc);
ns.bufferTime = 3;
//wowzaVideo.attachNetStream(ns);
//wowzaVideoDisplay.addChild(wowzaVideo);
ns.play("mp4:sample.mp4")
wowzaVideo.attachNetStream(ns);
wowzaVideoDisplay.addChild(wowzaVideo);
}
}
]]>
</fx:Script>
<mx:VideoDisplay id="wowzaVideoDisplay" x="404" y="48" width="282" height="222"/>
<mx:VideoDisplay id="camVideoDisplay" x="74" y="48" width="282" height="222"/>
</s:Application>