flex显示子项,而父项不可见

时间:2014-05-06 11:29:33

标签: flex osmf

我正在研究一个osmf播放器。全屏时,我的应用程序覆盖了我的视频。:

if(e.fullScreen)

    {   
        m_mediaPlayerSprite.width = m_mediaPlayerSprite.stage.fullScreenWidth;
        m_mediaPlayerSprite.height = m_mediaPlayerSprite.stage.fullScreenHeight;
    }
    else
    {   
        m_mediaPlayerSprite.width = m_width;
        m_mediaPlayerSprite.height = m_height;
    }

如果我设置application.visible = false,我的按钮栏会同时隐藏。当应用程序不可见时,有没有办法显示我的按钮?


实际上我在应用程序中添加了精灵。 mxml as:

<mx:Script>
    <![CDATA[
        import mx.core.UIComponent;
        private var m_videoBoard:VideoBoard;

        private function onApplicationComplete():void
        {
            m_videoBoard = new VideoBoard;
            m_videoBoard.setWidth(600);
            m_videoBoard.setHeight(450);
            m_videoBoard.setControlBar(myControlBar);
            m_videoBoard.setApplication(this);
            var component:UIComponent = new UIComponent;
            component.addChild(m_videoBoard);
            this.addElement(component);
            m_videoBoard.init();
        }


    ]]>
</mx:Script>
    <s:Label id="loadingPage" width="100%" height="450" backgroundColor="0x000000" text="" top="0" left="0"/>
    <local:MyControlBar id="myControlBar" width="100%" height="30" bottom="0"/>

并在VideoBoard中:

public function startPlaying():void
    {   
        m_container = new MediaContainer();
        var resource:URLResource = new URLResource(m_playFile);
        var loader:HTTPStreamingM3U8NetLoader = new HTTPStreamingM3U8NetLoader();

        var videoElement:VideoElement = new VideoElement(resource , loader);
        videoElement.smoothing = true;
        m_container.addMediaElement(videoElement);

        m_mediaPlayerSprite = new MediaPlayerSprite;
        m_mediaPlayerSprite.width = m_width;
        m_mediaPlayerSprite.height = m_height;

        m_mediaPlayer = m_mediaPlayerSprite.mediaPlayer;
        m_mediaPlayer.media = videoElement;
        m_mediaPlayer.autoDynamicStreamSwitch = true;
        m_mediaPlayer.addEventListener(PlayEvent.PLAY_STATE_CHANGE, onPlayStateChange);

        initControlBar();
        this.addChild(m_mediaPlayerSprite);

        m_mediaPlayerSprite.stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullScreen);
    }
有谁可以帮助我?或者在flex中使用osmf的完整全屏样本。

0 个答案:

没有答案