0

モバイル フレックス アプリケーション用の 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";
        }
4

2 に答える 2

2

これを試すことができます:

player.addEventListener(TimeEvent.COMPLETE, onComplete);
于 2012-05-15T08:07:22.943 に答える
0
function onComplete() {
  console.log("Completed");
}

player.addEventListener("complete", onComplete);

API ドキュメント http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/org/osmf/events/TimeEvent.html

于 2013-05-29T08:52:57.907 に答える