mx.controls
Class MediaDisplay


All Implemented Interfaces
           mx.controls.streamingmedia.ICuePointHolder

class MediaDisplay
extends mx.core.UIComponent

The MediaDisplay control lets media be streamed into an application without a supporting user interface. You can use this control with video and audio data. The user of your application has no control over the media when you use the MediaDisplay control by itself.

MXML Syntax

The <mx:MediacDisplay> tag inherits all the properties of its parent classes, and the following properties:

 <mx:MediaDisplay
aspectRatio="true|false"
associatedController="No default."
autoPlay="true|false"
autoSize="false|true"
contentPath="No default.
cuePoints="No default."
fps="30"
playing="true|false"
volume="75"
change = "Event handler. No default."
complete = "Event handler. No default."
cuePoint = "Event handler. No default."
progress = "Event handler. No default."
/>



Constructors
MediaDisplay ()
Constructor


Methods
      addCuePoint(aName:String, aTime:Number) : Void
Adds a new cue point to the display instance.
      addCuePointObject(aCuePoint:CuePoint) : Void
Adds a cue point.
      associateController(c:MediaController) : Void
Associates this display with a controller.
      getCuePoint(pointName:String) : CuePoint
Returns a cue point object.
      getCuePoints() : Array
Gets the Array of CuePoint objects that includes all the cue points associated with this object.
      handleEvent(ev:Object) : Void
Listens to events from the controller.
      handlePlayer(player:IPlayer, status:String) : Void
Handles events that are broadcast by the player implementation.
      measure() : Void
Measures the display and sets the preferred sizes.
      pause() : Void
Pauses playback of the media without moving the playhead.
      play(startingPoint:Number) : Void
Plays the media starting at the specified starting point.
      removeAllCuePoints() : Void
Deletes all the cue points associated with a given control.
      removeCuePoint(aCuePoint:CuePoint) : Void
Deletes a specified cue point associated with a given control.
      setCuePoints(cp:Array) : Void
Creates and populates an array of CuePoint objects.
      setMedia(aUrl:String, aType:String) : Void
Sets both the content path and the media type together.
      stop() : Void
Stops playback of the media and resets the playhead to zero.

Methods inherited from class mx.core.UIComponent
getFocus  setFocus  getFocusManager 

Methods inherited from class mx.core.UIObject
createAccessibilityImplementation  measure  doLater  cancelAllDoLaters  invalidate  invalidateStyle  invalidateProperties  invalidateSize  redraw  move  setSize  setSizeNoLayout  drawRect  fillRect  destroyLabel  createClassObject  createEmptyObject  destroyObject  getStyle  setMask  swapDepths 


Properties
staticversion:String  
MediaComponentVersion is for internal use only.
      fps:Number  
The frames per second, which is used only for video, and only in the configuration user interface.
      videoWidth:Number   [Read-Only]
True width of the video display.
      videoHeight:Number   [Read-Only]
True height of the video display.
      autoSize:Boolean   [Read-Write]
Whether the display sizes itself according to the preferred size of the media.
      aspectRatio:Boolean   [Read-Write]
If true, the MediaDisplay or MediaPlayback instance maintains the aspect ratio.
      autoPlay:Boolean   [Read-Write]
If true, the media immediately begins to buffer and play.
      playheadTime:Number   [Read-Write]
Playhead position, measured in seconds since starting playing.
      contentPath:String   [Read-Write]
Relative path and filename of the media to stream.
      volume:Number   [Read-Write]
The volume level, specified by an integer from 0 to 100.
      playing:Boolean   [Read-Only]
If true, the media is currently playing.
      bytesLoaded:Number   [Read-Only]
Number of bytes already loaded that are available for playing.
      bytesTotal:Number   [Read-Only]
Total number of bytes to load into the control.
      mediaType:String   [Read-Write]
Type of media to play, either Flash video (FLV), or MP3 file (MP3).
      totalTime:Number   [Read-Write]
Total length of the media in seconds.
      cuePoints:Array   [Read-Write]
Array of CuePoint objects that includes all the cue points assigned to a given control instance.
      mostRecentCuePoint:CuePoint   [Read-Only]
Read-only property that contains the most recently fired cue point.
      mostRecentCuePointTime:Number   [Read-Only]
Read-only property that contains the time, in seconds, within the playback media when the most recent cue point fired.
      associatedController:Void   [Write-Only]
MediaController control associated with the MediaDisplay control.

Properties inherited from class mx.core.UIComponent
version  enabled  tabIndex 

Properties inherited from class mx.core.UIObject
version  nestLevel  dispatchEvent  addEventListener  handleEvent  removeEventListener  kStretch  styleName  className  setStyle  parentApplication  isDocument  parentDocument  documentDescriptor  descriptor  instanceIndices  repeaterIndices  getRepeaterItem  id  width  height  x  y  minHeight  minWidth  preferredHeight  preferredWidth  maxHeight  maxWidth  widthFlex  heightFlex  visible  scaleX  scaleY  alpha  depth  mouseX  mouseY  toolTip  baselinePosition 


Effects

Effects inherited from class mx.core.UIComponent
showEffect  hideEffect  focusInEffect  focusOutEffect 

Effects inherited from class mx.core.UIObject
creationCompleteEffect  moveEffect  resizeEffect  mouseDownEffect  mouseOverEffect  mouseOutEffect  mouseUpEffect 


Events
changeBroadcasts continuously while media is playing. Target contains a reference to the component that triggered the event. Type contains the name of the event.
progressBroadcasts continuously until the media has downloaded completely. Target contains a reference to the component that triggered the event. Type contains the name of the event.
cuePointBroadcasts when the value of a cuepoint`s time property is equal to that of the playhead location of the MediaPlayback or MediaDisplay control with which it is associated. The event object contains the properties:
- cuePointName, which is a string that contains the name of the cuePoint.
- cuePointTime, which is an integer that contains the frame number or playing duration in seconds.
Target contains a reference to the component that triggered the event. Type contains the name of the event.
completeBroadcasts when the playhead has reached the end of the media. Target contains a reference to the component that triggered the event. Type contains the name of the event.
startBroadcast when enough media has been buffered to begin play. Target contains a reference to the component that triggered the event. Type contains the name of the event.

Events inherited from class: mx.core.UIComponent
focusIn  focusOut  keyDown  keyUp  show  hide  valid  invalid  valueCommitted 

Events inherited from class: mx.core.UIObject
initialize  creationComplete  resize  move  draw  load  unload  mouseDown  mouseUp  mouseMove  mouseOver  mouseOut  mouseDownSomewhere  mouseUpSomewhere  mouseMoveSomewhere  mouseChangeSomewhere  effectStart  effectEnd  dragBegin  dragComplete  dragEnter  dragOver  dragExit  dragDrop 


Styles

Styles inherited from class mx.core.UIComponent
backgroundColor  backgroundDisabledColor  backgroundImage  backgroundAlpha  backgroundSize  barColor  borderCapColor  borderColor  buttonColor  borderStyle  disabledColor  errorColor  highlightColor  lineHeight  modalTransparency  scrollTrackColor  shadowColor  shadowCapColor  symbolColor  symbolBackgroundColor  symbolBackgroundDisabledColor  symbolBackgroundPressedColor  symbolDisabledColor  themeColor 

Styles inherited from class mx.core.UIObject
color  fontFamily  fontSize  fontStyle  fontWeight  textAlign  textDecoration  textIndent  marginLeft  marginRight  horizontalGap  verticalGap 


Constructor Detail

MediaDisplay

MediaDisplay()

Constructor


Method Detail

addCuePoint

addCuePoint(aName:String, aTime:Number) : Void

Adds a new cue point to the display instance.

Parameters
     aName - Name of the cue point.
     aTime - Time in the media where to add the cue point.


addCuePointObject

addCuePointObject(aCuePoint:CuePoint) : Void

Adds a cue point.

Parameters
     aCuePoint - The cue point to add.


associateController

associateController(c:MediaController) : Void

Associates this display with a controller. Sets up the event listeners between the two.

Parameters
     c -


getCuePoint

getCuePoint(pointName:String) : CuePoint

Returns a cue point object.

Parameters
     pointName - Name of the cue point to find.

Returns
     CuePoint associated with this object that has the given name.


getCuePoints

getCuePoints() : Array

Gets the Array of CuePoint objects that includes all the cue points associated with this object.

Returns
     Array of CuePoint objects.


handleEvent

handleEvent(ev:Object) : Void

Listens to events from the controller. The following events are propagated: click, playheadChange, volume.

Parameters
     ev - Event broadcast from the controller.


handlePlayer

handlePlayer(player:IPlayer, status:String) :  Void

Handles events that are broadcast by the player implementation.

Parameters
     player - Player.
     status - Status.


measure

measure() : Void

Measures the display and sets the preferred sizes. This is applicable only to video. If the width or height attributes are set, it uses those. Otherwise, it uses the video`s true width and height.


pause

pause() : Void

Pauses playback of the media without moving the playhead.


play

play(startingPoint:Number) : Void

Plays the media starting at the specified starting point. If the media hasn`t yet been loaded, it loads it.

Parameters
     startingPoint - The number of seconds into the media where the playback should start. This is an optional parameter. If omitted, playing starts at the current playhead position.


removeAllCuePoints

removeAllCuePoints() : Void

Deletes all the cue points associated with a given control.


removeCuePoint

removeCuePoint(aCuePoint:CuePoint) : Void

Deletes a specified cue point associated with a given control.

Parameters
     aCuePoint - Cue point to remove.


setCuePoints

setCuePoints(cp:Array) : Void

Creates and populates an array of CuePoint objects.

Parameters
     cp - Array of CuePoint objects.


setMedia

setMedia(aUrl:String, aType:String) :  Void

Sets both the content path and the media type together.

Parameters
     aUrl -
     aType - Media type.


stop

stop() : Void

Stops playback of the media and resets the playhead to zero.


Property Detail

aspectRatio

aspectRatio:Boolean   [Read-Write]

If true, the MediaDisplay or MediaPlayback instance maintains the aspect ratio. The default value is true.


associatedController

associatedController:Void   [Write-Only]

MediaController control associated with the MediaDisplay control.


autoPlay

autoPlay:Boolean   [Read-Write]

If true, the media immediately begins to buffer and play. This is strictly an initialization property. The default is true. for a MediaDisplay control, set this property to the same value as the activePlayControl property of any associated Mediacontroller control.


autoSize

autoSize:Boolean   [Read-Write]

Whether the display sizes itself according to the preferred size of the media.


bytesLoaded

bytesLoaded:Number   [Read-Only]

Number of bytes already loaded that are available for playing.


bytesTotal

bytesTotal:Number   [Read-Only]

Total number of bytes to load into the control.


contentPath

contentPath:String   [Read-Write]

Relative path and filename of the media to stream.


cuePoints

cuePoints:Array   [Read-Write]

Array of CuePoint objects that includes all the cue points assigned to a given control instance. The name of the cue point is arbitrary and should be set so that its name has meaning when using listener and trace events. The time property specifies the playhead location of the MediaPlayback or MediaDisplay control with which the cue point is assoiciated.


fps

fps:Number  

The frames per second, which is used only for video, and only in the configuration user interface. The configuration user interface uses this property to calculate milliseconds based on frame number. The default value is 30.


mediaType

mediaType:String   [Read-Write]

Type of media to play, either Flash video (FLV), or MP3 file (MP3).


mostRecentCuePoint

mostRecentCuePoint:CuePoint   [Read-Only]

Read-only property that contains the most recently fired cue point. This is unbindable because binding cannot handle structures.


mostRecentCuePointTime

mostRecentCuePointTime:Number   [Read-Only]

Read-only property that contains the time, in seconds, within the playback media when the most recent cue point fired.


playheadTime

playheadTime:Number   [Read-Write]

Playhead position, measured in seconds since starting playing.


playing

playing:Boolean   [Read-Only]

If true, the media is currently playing.


totalTime

totalTime:Number   [Read-Write]

Total length of the media in seconds. For MP3 files, this is a property of the Sound object. For video, it is a property that the author sets manually.


version

static version:String  

MediaComponentVersion is for internal use only.


videoHeight

videoHeight:Number   [Read-Only]

True height of the video display.


videoWidth

videoWidth:Number   [Read-Only]

True width of the video display.


volume

volume:Number   [Read-Write]

The volume level, specified by an integer from 0 to 100. The default is 75.