Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -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);
}
Expand DownExpand Up@@ -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 {
Expand Down
7 changes: 1 addition & 6 deletions core/src/actionscript/org/flowplayer/model/Playlist.as
Original file line numberDiff line numberDiff line change
Expand Up@@ -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) {
Expand Down