0

I'm working on a osmf player. my application covered my video when full screen.as:

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;
    }

and if I set application.visible = false, my buttonbar hide at the same time. Is there a way to show my buttonbar while application is invisible ?


in fact I add sprite to application. 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"/>

and in 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);
    }

could anyone help me? or a complete fullscreen sample with osmf in flex.

  • 1
    Sorry, can't help unless you give more info (code). But in general, it should be no problem to add another layer on top of your player. If you have a sprite and 'addChild(player); addChild(buttonBar);' your buttonbar should be on top, regardles player is visible. – T. Richter May 06 '14 at 12:39
  • thanks for reply! I've edit my post. what's wrong with my code? thank you again – user3607923 May 07 '14 at 01:46
  • Sorry, I still don't get the point here. Your code looks fine to me (at least from reading it) , but it doesn't actually hide anything, does it? Instead of setting application.visible=false, which will obviously hide all the app, you could try to set the application background to transparent and hide it's child containers. Don't know if I'm on the right track with what you are trying to achieve, though. – T. Richter May 07 '14 at 07:54
  • when stage.displayState = StageDisplayState.NORMAL, MediaPlayerSprite exactly show on the top of application.but when stage.displayState = StageDisplayState.FULLSCREEN MediaPlayerSprite show behind application. I've try to set application.backgroundAlipa = 0, but it doesn't work. – user3607923 May 07 '14 at 10:49
  • It seems that MediaPlayerSprite acts as stage's background when fullscreen. I used Video build a player before, code is almost the same and work well, but now I have to use osmf to play hls resource. the issue has took my several days :( ... – user3607923 May 07 '14 at 10:59

0 Answers0