Commit 6e38cff2 authored by Dan Rossi's avatar Dan Rossi
Browse files

- #70 fixes for live and dvr offset with httpstreaming. don't dispatch start...

- #70 fixes for live and dvr offset with httpstreaming. don't dispatch start on dvr snap to live, only on metadata or else buffering display stays enabled.
parent 0731f2af
......@@ -32,6 +32,7 @@ package org.flowplayer.httpstreaming {
import org.osmf.net.httpstreaming.HTTPNetStream;
import org.osmf.net.httpstreaming.f4f.HTTPStreamingF4FFactory;
import org.osmf.net.httpstreaming.dvr.DVRInfo;
import org.osmf.net.StreamingURLResource;
import org.osmf.metadata.Metadata;
import org.osmf.metadata.MetadataNamespaces;
import org.osmf.media.URLResource;
......@@ -98,7 +99,7 @@ package org.flowplayer.httpstreaming {
_dvrIsRecording = false;
//#70 fixes for live streams.
netStream.play(clip.url, clip.live ? -1 : clip.start);
netStream.play(clip.url, clip.live && !isDvr ? -1 : clip.start);
}
private function onPlayStatus(event:ClipEvent) : void {
......@@ -175,10 +176,9 @@ package org.flowplayer.httpstreaming {
log.debug("in NetStreamControllingStremProvider.onMetaData: " + event.target);
//#70 remove clip duration for live streams and when not dvr recording
if (clip.live && !_dvrIsRecording) clip.metaData.duration = null;
if (clip.live && !isDvr) clip.metaData.duration = null;
//if we are not dvr recording dispatch start
if (! clip.startDispatched && !_dvrIsRecording) {
if (! clip.startDispatched) {
clip.dispatch(ClipEventType.START, pauseAfterStart);
clip.startDispatched = true;
}
......@@ -230,10 +230,6 @@ package org.flowplayer.httpstreaming {
//dispatch the dvr event
dispatchDVREvent(_dvrInfo);
//dispatch clip start
clip.dispatch(ClipEventType.START, false);
clip.startDispatched = true;
//seek to the closest offset to the live position determined by the current dvr duration, buffertime and live snap offset.
var livePosition:Number = Math.max(0, dvrSeekOffset);
this.netStream.seek(livePosition);
......@@ -242,6 +238,11 @@ package org.flowplayer.httpstreaming {
}
private function get isDvr():Boolean
{
return StreamingURLResource(netResource).streamType == "dvr";
}
private function dispatchDVREvent(dvrInfo:DVRInfo):void
{
log.debug("Seeking to DVR position");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment