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.