Wowza Community

http flash player in as3

Hi:

we want to use the ndvr plugin, and we want to create a plash player with flash professional cs5.5 and as3.

I have looked for examples about this but all I got are samples for flex and flash builder. I need to develop in flash cs5.5 because we have made some functionality for our player and is all in a fla file, so I just need to include the methods to get my player in that file. I have tested with this code:

import flash.display.Stage;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.media.Video;
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.net.URLStream;
import flash.events.Event;
import flash.utils.ByteArray;
    const vurl = "http://mywowzaserver:1935/live/test/manifest.f4m"
    var nc:NetConnection;
    var ns:NetStream;
    var vo:Video;
    var urlstream:URLStream;
    function Player() {
        nc = new NetConnection();
        nc.connect(null);
        ns = new NetStream(nc);
        
        vo = new Video(200,113);
	vo.attachNetStream(ns);
		
        addChild(vo);
        ns.play(null);
        var urlrequest:URLRequest = new URLRequest(vurl)
         urlstream = new URLStream();
        urlstream.addEventListener(Event.COMPLETE, completeHandler);
        urlstream.load(urlrequest);
    }
    function completeHandler(event:Event):void {
        trace("completeHandler: " + event);
        var bytes:ByteArray = new ByteArray();
        urlstream.readBytes(bytes);
        ns.appendBytes(bytes);
    }
Player();

but nothing happens, I have no error at all, but I never watch my live video. I have tested the url in the FlashHTTPPlayer I got in the samples and works ok, so what am I doing wrong?

thanks for the help.

Flash RTMP playback is not supported with Wowza nDVR. You need to use Flash application that is using the OSMF framework.

Richard

There are examples included in the Wowza /examples folder, in the LiveVideoStreaming/FlashHTTPPlayer and VideoOnDemandStreaming/FlashHTTPPlayer folders. This is a great starting place.

Richard

but I am trying with http not with rtmp.

can I use OSMF Framework inside flash cs5 professional, I cant find how. is there any usefull sample code or tutorial?

thanks so much.

I can see the samples, they are flash builder samples, I will try with those, thanks so much