Commit fdb48ae3 authored by Anssi Piirainen's avatar Anssi Piirainen
Browse files

Don’t clear the video when stopping the stream. (#81)

parent ed1fbe61
......@@ -17,35 +17,30 @@
*/
package org.flowplayer.controller {
import org.flowplayer.controller.StreamProvider;
import org.flowplayer.controller.TimeProvider;
import org.flowplayer.controller.VolumeController;
import org.flowplayer.model.Clip;
import org.flowplayer.model.ClipError;
import org.flowplayer.model.ClipEvent;
import org.flowplayer.model.ClipEventType;
import org.flowplayer.model.EventType;
import org.flowplayer.model.Playlist;
import org.flowplayer.model.PluginEventType;
import org.flowplayer.model.PluginModel;
import org.flowplayer.model.ProviderModel;
import org.flowplayer.util.Assert;
import org.flowplayer.util.Log;
import org.flowplayer.view.Flowplayer;
import flash.utils.Dictionary;
import flash.display.DisplayObject;
import flash.errors.IOError;
import flash.events.NetStatusEvent;
import flash.events.TimerEvent;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.utils.Timer;
CONFIG::FLASH_10_1 {
import flash.display.DisplayObject;
import flash.errors.IOError;
import flash.events.NetStatusEvent;
import flash.events.TimerEvent;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.utils.Dictionary;
import flash.utils.Timer;
import org.flowplayer.model.Clip;
import org.flowplayer.model.ClipError;
import org.flowplayer.model.ClipEvent;
import org.flowplayer.model.ClipEventType;
import org.flowplayer.model.Playlist;
import org.flowplayer.model.PluginModel;
import org.flowplayer.model.ProviderModel;
import org.flowplayer.util.Assert;
import org.flowplayer.util.Log;
import org.flowplayer.view.Flowplayer;
CONFIG::FLASH_10_1 {
import org.flowplayer.view.StageVideoWrapper;
}
}
/**
* A StreamProvider that does it's job using the Flash's NetStream class.
......@@ -211,6 +206,7 @@ package org.flowplayer.controller {
* @inheritDoc
*/
public final function resume(event:ClipEvent):void {
log.debug("resume");
_paused = false;
_stopping = false;
doResume(_netStream, event);
......@@ -545,13 +541,14 @@ package org.flowplayer.controller {
}
protected function doSwitchStream(event:ClipEvent, netStream:NetStream, clip:Clip, netStreamPlayOptions:Object = null):void {
import flash.net.NetStreamPlayOptions;
//fix for #279, switch and pause if the current clip is currently in a paused state
//#404 implement netstreamplayoptions for http streams, resets the stream or start loading a new stream.
//implement switch support for flash9 players that do not support dynamic switching
if (CONFIG::FLASH_10_1) {
if (netStreamPlayOptions) {
pauseAfterStart = paused;
import flash.net.NetStreamPlayOptions;
if (netStreamPlayOptions is NetStreamPlayOptions) {
log.debug("doSwitchStream() calling play2()");
//#461 when we have a clip base url set, we need the complete clip url sent to play2 for http streams.
......@@ -877,10 +874,6 @@ package org.flowplayer.controller {
_startedClip = null;
log.debug("doStop(), closing netStream and connection");
if (clip.getContent() is Video) {
Video(clip.getContent()).clear();
}
try {
netStream.close();
_netStream = null;
......
......@@ -129,11 +129,11 @@ package org.flowplayer.controller {
log.debug("stop() called");
if (silent) {
getMediaController().onEvent(null, [closeStreamAndConnection]);
getMediaController().onEvent(ClipEventType.STOP, [closeStreamAndConnection, true]);
if (closeStreamAndConnection && playList.current.parent != null) {
playList.setInStreamClip(null);
getMediaController().onEvent(null, [true]);
getMediaController().onEvent(ClipEventType.STOP, [true, true]);
}
} else {
......
......@@ -119,6 +119,7 @@ package org.flowplayer.controller {
}
public function get durationReached():Boolean {
if (_clip.live) return false;
if (_clip.durationFromMetadata > _clip.duration) {
return time >= _clip.duration;
}
......
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