我已经为我的移动 flex 应用程序构建了一个 OSMF 播放器信息,但我找不到一种方法来判断视频何时播放完毕。我能以某种方式告诉视频何时完成吗?
提前致谢!
import mx.core.UIComponent;
import org.osmf.events.TimeEvent;
import spark.components.Button;
import spark.components.Group;
public var playerInstance:StrobeMediaPlayback;
public var grp:Group = new Group();
protected function init(event:Event):void
{
_stage = systemManager.stage;
_stage.align = StageAlign.TOP_LEFT;
_parameters =
{
src:"assets/Mini film 2b with filter on.mp4"
, controlBarMode:"docked"
, controlBarAutoHide: true
, autoPlay: true
, playButtonOverlay:true
, showVideoInfoOverlayOnStartUp: true
};
var playerInstance:StrobeMediaPlayback = new StrobeMediaPlayback();
playerInstance.initialize(_parameters, _stage, systemManager.loaderInfo, null);
playerInstance = playerInstance;
//playerInstance.addEventListener(, remove);
var ui:UIComponent = new UIComponent();
ui.addChild(playerInstance as DisplayObject);
grp.percentWidth = 100;
grp.percentHeight = 100;
addElement(grp);
grp.addElement(ui);
actionBarVisible = false
}
private var urlLoader:URLLoader;
private var urlRequest:URLRequest;
private var loader:Loader;
private var _stage:Stage;
private var _parameters:Object;
/* static */
private static const ALLOW_LOAD_BYTES_CODE_EXECUTION:String = "allowLoadBytesCodeExecution";
public function emptyCache():void
{
//playerInstance.player.pause();
grp.removeAllElements();
this.destructionPolicy = "auto";
}