Commit 634759e7 authored by Dan Rossi's avatar Dan Rossi
Browse files

- #50 if we have metadata already set it is being updated during seeks and...

 - #50 if we have metadata already set it is being updated during seeks and switching, dispatch metadata change events instead. new clip event method added onMetadataChange
parent 0fbe863a
......@@ -12,6 +12,7 @@ Version history:
unbinding and binding stage video events caused issues with instream playlists therefore has to be kept binded.
unbinded stage video events during seeking to prevent the mask repositioning.
- #53 update url filter to accomodate for pretty urls with semi colons.
- #50 if we have metadata already set it is being updated during seeks and switching, dispatch metadata change events instead.
3.2.14
------
......
......@@ -47,6 +47,7 @@ package org.flowplayer.controller {
}
public function onMetaData(infoObject:Object):void {
log.info("onMetaData, current clip " + _clip);
log.debug("onMetaData, data for clip " + _clip + ":");
......@@ -77,7 +78,7 @@ package org.flowplayer.controller {
}
log.debug("metaData : ", metaData);
_clip.metaData = metaData;
if (metaData.cuePoints && _clip.cuepoints.length == 0) {
log.debug("clip has embedded cuepoints");
......@@ -86,7 +87,15 @@ package org.flowplayer.controller {
_previousUrl = _clip.url;
_clip.dispatch(ClipEventType.METADATA);
//#50 if we have metadata already set it is being updated during seeks and switching, dispatch metadata change events instead.
if (_clip.metaData) {
_clip.metaData = metaData;
_clip.dispatch(ClipEventType.METADATA_CHANGED);
} else {
_clip.metaData = metaData;
_clip.dispatch(ClipEventType.METADATA);
}
log.info("metaData parsed and injected to the clip");
}
......
......@@ -138,6 +138,11 @@ package org.flowplayer.controller {
return clip.provider == (_model ? _model.name : (clip.parent ? 'httpInstream' : 'http'));
});
//#50 dispatch metadata events on updates also
clip.onMetaDataChange(onMetaData, function(clip:Clip):Boolean {
return clip.provider == (_model ? _model.name : (clip.parent ? 'httpInstream' : 'http'));
});
//#614 when the clip ends if the next clip in the provider has a different provider close the provider stream.
clip.onFinish(closeStream, function(clip:Clip):Boolean {
//#42 pass instream clips through and close the stream
......@@ -146,6 +151,10 @@ package org.flowplayer.controller {
});
clip.startDispatched = false;
//#50 clear metadata when replaying in a playlist
clip.metaData = false;
log.debug("previously started clip " + _startedClip);
if (attempts == 3 && _startedClip && _startedClip == clip && _connection && _netStream) {
log.info("playing previous clip again, reusing existing connection and resuming");
......@@ -805,6 +814,8 @@ package org.flowplayer.controller {
private function onConnectionSuccess(connection:NetConnection):void {
_connection = connection;
//reset start dispatching if reconnecting
clip.startDispatched = false;
//#430 adding event listeners for netconnection
connection.addEventListener(NetStatusEvent.NET_STATUS, _onNetStatus);
_createNetStream();
......
......@@ -54,7 +54,7 @@ package org.flowplayer.model {
if (eventType == ClipEventType.CUEPOINT) {
return Cuepoint(info).callbackId;
}
if ([ClipEventType.START, ClipEventType.UPDATE, ClipEventType.METADATA, ClipEventType.RESUME, ClipEventType.BEGIN].indexOf(eventType) >= 0) {
if ([ClipEventType.START, ClipEventType.UPDATE, ClipEventType.METADATA, ClipEventType.METADATA_CHANGED, ClipEventType.RESUME, ClipEventType.BEGIN].indexOf(eventType) >= 0) {
return target;
}
return super.externalEventArgument2;
......
......@@ -61,6 +61,10 @@ package org.flowplayer.model {
setListener(ClipEventType.METADATA, listener, clipFilter, false, addToFront);
}
public function onMetaDataChange(listener:Function, clipFilter:Function = null, addToFront:Boolean = false):void {
setListener(ClipEventType.METADATA_CHANGED, listener, clipFilter, false, addToFront);
}
public function onBeforeBegin(listener:Function, clipFilter:Function = null, addToFront:Boolean = false):void {
setListener(ClipEventType.BEGIN, listener, clipFilter, true, addToFront);
}
......
......@@ -26,6 +26,7 @@ import org.flowplayer.flow_internal;
public static const CONNECT:ClipEventType = new ClipEventType("onConnect");
public static const BEGIN:ClipEventType = new ClipEventType("onBegin");
public static const METADATA:ClipEventType = new ClipEventType("onMetaData");
public static const METADATA_CHANGED:ClipEventType = new ClipEventType("onMetaDataChange");
public static const START:ClipEventType = new ClipEventType("onStart");
public static const PAUSE:ClipEventType = new ClipEventType("onPause");
public static const RESUME:ClipEventType = new ClipEventType("onResume");
......
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