DVR w/ FLVPlayback 2.5.0.15 & Custom Publishing Client - Seek Bar Not Working [updated]
[ UPDATED to include code and modified language after I discovered that everything works when I use Live Encoder.... ]
Hello.
So I've got the DVRCast application installed, and I am successfully streaming live-DVR content to the updated FLVPlayback component. I'm able to access the DVR-specific metadata (e.g. "currLen") without any trouble, and so forth.
When I record with the Flash Live Encoder, everything works correctly; the seek bar fills in as more content is published, and the playhead advances slowly across the filled-in section of the seek bar.
But when I do the publishing with a custom client instead of Flash Live Encoder, the seek bar doesn't work right. Specifically, when I start viewing a stream which is still being broadcast live, the seek bar shows the length of the stream at the moment I started viewing it; however, the seek bar doesn't update correctly as new content continues to be appended to the end of the stream. What happens instead is that the "playhead" (not sure of the proper terminology here) moves along the seek bar until it reaches the end, and then it just sits at the end -- and the seek bar itself starts expanding to the right, off the edge of the stage!
So I assume the problem here is that I need to add some code to the publishing client. Here's the meat of the publishing code (from MyDVRPublish.as, which is the document class for MyDVRPublish.fla):
public function MyDVRPublish()
{
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
nc.connect("rtmp://localhost/DVRCast");
dvrFlag = true;
isVideoReady = false;
streamID = null;
vid = new Video(640, 480);
vid.x = 0;
vid.y = 0;
vidMonitor.addChild(vid);
cam = Camera.getCamera();
cam.setQuality(0,90);
cam.setMode(640, 480, 30);
vid.attachCamera(cam);
}
private function onNetStatus(event:NetStatusEvent):void{
trace(event.info.code);
if(event.info.code == "NetConnection.Connect.Success"){
doRecording("mystream");
}
}
private function doRecording(sID:String) {
isRecording = true;
streamID = sID;
publishCamera();
}
private function stopRecording() {
ns.close();
isRecording = false;
trace("Finished recording " + streamID);
}
private function onAsyncError(event:AsyncErrorEvent):void{
trace(event.text);
}
private function publishCamera() {
ns = new NetStream(nc);
ns.client = new CustomClient();
ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
ns.attachCamera(cam);
trace("Publishing Stream...");
ns.publish(streamID, "record");
}
...What am I missing?
Thanks,
-dan
Message was edited by DanMITRE.
