Packagecom.devnet.osmf.application
Classpublic class ControlBar
InheritanceControlBar Inheritance MediaControl Inheritance flash.display.MovieClip

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 10.0.0

The ControlBar class creates a component that manages user interface controls for the MediaDisplay component.

Example: This example shows how to assign the media display instance to the control bar instance.

     
    // Link the controls to the display...
    controlBar.mediaPlayer = mediaDisplay;
     

Example: This example shows how to configure the ControlBar instance using ActionScript.

     
    // Setup control bar
    controlBar.hdWidth = 768;
    controlBar.hdHeight = 428;
    controlBar.shareUrl = "http://www.adobe.com/devnet/flash/";
    controlBar.useElapsedTime = false;
    controlBar.useFullScreenButton = false;
    controlBar.useVolumeButton = false;
     
The examples above assume that the components exist on the Stage with respective instance names; mediaPlayer and controlBar.

See also

MediaDisplay


Public Properties
 PropertyDefined By
  background : Sprite
ControlBar
  elapsedTime : ElapsedTime
ControlBar
  fullScreenButton : SimpleButton
ControlBar
  hdHeight : Number
Set the actual size of the video height here in order to trigger hardware accerlation scaling during full screen mode.
ControlBar
  hdWidth : Number
Set the actual size of the video width here in order to trigger hardware accerlation scaling during full screen mode.
ControlBar
  hline : Sprite
ControlBar
 InheritedmediaPlayer : MediaDisplay
Set the mediaPlayer property to associate a media display instance with a control instance.
MediaControl
  playOverlay : PlayScreen
ControlBar
  playPauseButton : SimpleButton
ControlBar
  seekBar : SeekBar
ControlBar
  seekEnabled : Boolean
Set seekEnabled to false when using progressive video whose encoding creates unpredictable seek times.
ControlBar
  shareButton : SimpleButton
ControlBar
  shareColumns : Number
Set the number of icon columns in the AddThis share menu widget.
ControlBar
  shareDisplayState : Number
Set the display layout state of the AddThis share menu.
ControlBar
  shareUrl : String
Set the URL to share when an AddThis share option is selected.
ControlBar
  useElapsedTime : Boolean
Set to true to show the elapsed time control or false to hide it.
ControlBar
  useFullScreenButton : Boolean
Set to true to show the full screen button or false to hide it.
ControlBar
  usePlayOverlay : Boolean
Set to true to show the play button overlay or false to hide it.
ControlBar
  usePlayPauseButton : Boolean
Set to true to show the play pause button or false to hide it.
ControlBar
  useSeekBar : Boolean
Set to true to show the seek bar or false to hide it.
ControlBar
  useShareButton : Boolean
Set to true to show the share button and menu or false to hide it.
ControlBar
  useVolumeButton : Boolean
Set to true to show the volume button or false to hide it.
ControlBar
  useVolumeSlider : Boolean
Set to true to show the volume slider or false to hide it.
ControlBar
  volumeButton : SimpleButton
ControlBar
  volumeSlider : VolumeSlider
ControlBar
Public Methods
 MethodDefined By
  
ControlBar
  
init():void
[override] Called when the mediaPlayer reference is set.
ControlBar
  
setSize(w:Number, h:Number):void
Sets the size of the control bar.
ControlBar
Protected Methods
 MethodDefined By
  
addedToStageHandler(event:Event):void
ControlBar
  
onFullScreenChange(event:FullScreenEvent):void
ControlBar
  
onFullScreenClick(event:MouseEvent):void
ControlBar
  
ControlBar
  
ControlBar
  
onPlayClick(event:MouseEvent):void
ControlBar
  
onPlayPauseClick(event:MouseEvent):void
ControlBar
  
onShareClick(event:MouseEvent):void
ControlBar
  
onShareMenuLoaded(event:Event):void
ControlBar
  
onVolumeChange(event:Event):void
ControlBar
  
onVolumeClick(event:MouseEvent):void
ControlBar
Property Detail
backgroundproperty
public var background:Sprite

elapsedTimeproperty 
public var elapsedTime:ElapsedTime

fullScreenButtonproperty 
public var fullScreenButton:SimpleButton

hdHeightproperty 
hdHeight:Number

Set the actual size of the video height here in order to trigger hardware accerlation scaling during full screen mode. Leaving this parameter null forces the media display to use standard Flash Player scaling during full screen mode.


Implementation
    public function get hdHeight():Number
    public function set hdHeight(value:Number):void
hdWidthproperty 
hdWidth:Number

Set the actual size of the video width here in order to trigger hardware accerlation scaling during full screen mode. Leaving this parameter null forces the media display to use standard Flash Player scaling during full screen mode.


Implementation
    public function get hdWidth():Number
    public function set hdWidth(value:Number):void
hlineproperty 
public var hline:Sprite

playOverlayproperty 
public var playOverlay:PlayScreen

playPauseButtonproperty 
public var playPauseButton:SimpleButton

seekBarproperty 
public var seekBar:SeekBar

seekEnabledproperty 
seekEnabled:Boolean

Set seekEnabled to false when using progressive video whose encoding creates unpredictable seek times. Doing so switches the seek bar to a progress indicator.


Implementation
    public function get seekEnabled():Boolean
    public function set seekEnabled(value:Boolean):void
shareButtonproperty 
public var shareButton:SimpleButton

shareColumnsproperty 
shareColumns:Number

Set the number of icon columns in the AddThis share menu widget.


Implementation
    public function get shareColumns():Number
    public function set shareColumns(value:Number):void
shareDisplayStateproperty 
shareDisplayState:Number

Set the display layout state of the AddThis share menu.


Implementation
    public function get shareDisplayState():Number
    public function set shareDisplayState(value:Number):void
shareUrlproperty 
shareUrl:String

Set the URL to share when an AddThis share option is selected.


Implementation
    public function get shareUrl():String
    public function set shareUrl(value:String):void
useElapsedTimeproperty 
useElapsedTime:Boolean

Set to true to show the elapsed time control or false to hide it.


Implementation
    public function get useElapsedTime():Boolean
    public function set useElapsedTime(value:Boolean):void
useFullScreenButtonproperty 
useFullScreenButton:Boolean

Set to true to show the full screen button or false to hide it.


Implementation
    public function get useFullScreenButton():Boolean
    public function set useFullScreenButton(value:Boolean):void
usePlayOverlayproperty 
usePlayOverlay:Boolean

Set to true to show the play button overlay or false to hide it.


Implementation
    public function get usePlayOverlay():Boolean
    public function set usePlayOverlay(value:Boolean):void
usePlayPauseButtonproperty 
usePlayPauseButton:Boolean

Set to true to show the play pause button or false to hide it.


Implementation
    public function get usePlayPauseButton():Boolean
    public function set usePlayPauseButton(value:Boolean):void
useSeekBarproperty 
useSeekBar:Boolean

Set to true to show the seek bar or false to hide it.


Implementation
    public function get useSeekBar():Boolean
    public function set useSeekBar(value:Boolean):void
useShareButtonproperty 
useShareButton:Boolean

Set to true to show the share button and menu or false to hide it.


Implementation
    public function get useShareButton():Boolean
    public function set useShareButton(value:Boolean):void
useVolumeButtonproperty 
useVolumeButton:Boolean

Set to true to show the volume button or false to hide it. If set to false, the volume slider is unavailable.


Implementation
    public function get useVolumeButton():Boolean
    public function set useVolumeButton(value:Boolean):void
useVolumeSliderproperty 
useVolumeSlider:Boolean

Set to true to show the volume slider or false to hide it. If set to false, the volume button becomes a mute toggle button.


Implementation
    public function get useVolumeSlider():Boolean
    public function set useVolumeSlider(value:Boolean):void
volumeButtonproperty 
public var volumeButton:SimpleButton

volumeSliderproperty 
public var volumeSlider:VolumeSlider

Constructor Detail
ControlBar()Constructor
public function ControlBar()



Method Detail
addedToStageHandler()method
protected function addedToStageHandler(event:Event):void

Parameters

event:Event

init()method 
override public function init():void

Called when the mediaPlayer reference is set. Use this method to initialize the control with the OSMF media display.

onFullScreenChange()method 
protected function onFullScreenChange(event:FullScreenEvent):void

Parameters

event:FullScreenEvent

onFullScreenClick()method 
protected function onFullScreenClick(event:MouseEvent):void

Parameters

event:MouseEvent

onMediaPlayerEvent()method 
protected function onMediaPlayerEvent(event:MediaEvent):void

Parameters

event:MediaEvent

onMediaPlayerProgress()method 
protected function onMediaPlayerProgress(event:ProgressEvent):void

Parameters

event:ProgressEvent

onPlayClick()method 
protected function onPlayClick(event:MouseEvent):void

Parameters

event:MouseEvent

onPlayPauseClick()method 
protected function onPlayPauseClick(event:MouseEvent):void

Parameters

event:MouseEvent

onShareClick()method 
protected function onShareClick(event:MouseEvent):void

Parameters

event:MouseEvent

onShareMenuLoaded()method 
protected function onShareMenuLoaded(event:Event):void

Parameters

event:Event

onVolumeChange()method 
protected function onVolumeChange(event:Event):void

Parameters

event:Event

onVolumeClick()method 
protected function onVolumeClick(event:MouseEvent):void

Parameters

event:MouseEvent

setSize()method 
public function setSize(w:Number, h:Number):void

Sets the size of the control bar. Adjust this method if you change the layout of controls.

Parameters

w:Number — Number representing the new width.
 
h:Number — Number representing the new height.