Commit 1f63b4af authored by Daniel Rossi's avatar Daniel Rossi

- fixes for #163 clear the stream on clip content within the playlist...

- fixes for #163 clear the stream on clip content within the playlist controller , there are two playlist replacement features to handle it in.
parent 6609cde5
......@@ -67,6 +67,7 @@ package org.flowplayer.controller {
flow_internal function setPlaylist(clips:Array):void {
if (getState() != State.WAITING) {
close(false);
clearStream();
}
_playList.replaceClips2(clips);
}
......@@ -328,10 +329,20 @@ package org.flowplayer.controller {
}
}
//#163 detach netstream on the current clip
private function clearStream():void
{
if (_playList.current && _playList.current.getContent() && _playList.current.getContent().hasOwnProperty("attachNetStream")) {
Object(_playList.current.getContent()).attachNetStream(null);
}
}
private function replacePlaylistAndPlay(clips:Object):void {
//#163 stop the connection and stream
_state.stop(true, true);
clearStream();
if (clips is Clip) {
_playList.replaceClips(clips as Clip);
} else {
......
......@@ -77,15 +77,10 @@ package org.flowplayer.model {
doAddClip(clips[i], -1, false);
}
}
private function doReplace(newClips:Array, silent:Boolean = false):void {
var oldClips:Array = _clips.concat([]);
//#163 detach netstream on the current clip
if (_clips[_currentPos] && _clips[_currentPos].getContent().hasOwnProperty("attachNetStream")) {
_clips[_currentPos].getContent().attachNetStream(null);
}
initialize(newClips);
if (! silent) {
......
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