All Implemented Interfaces
The MediaPlayback control is a combination of the MediaController and MediaDisplay controls. It provides methods to stream media content, and an interface that lets users control playback.
MXML Syntax
The <mx:MediaPlayback> tag inherits all the properties of its parent classes, and the following properties:
<MediaPlayback
aspectRatio = "true|false"
autoPlay = "true|false"
autoSize = "false|true"
contentPath = "No default.
controllerPolicy = "auto|on|off"
controlPlacement = "bottom|top|left|right"
cuePoints = "No default."
fps = "30"
volume = "75"
change = "Event handler. No default."
click = "Event handler. No default."
complete = "Event handler. No default."
cuePoint = "Event handler. No default."
playheadChange = "Event handler. No default."
progress = "Event handler. No default."
volumeChange = "Event handler. No default."
/>
| Constructors | |
MediaPlayback
()
Constructor |
|
| Methods | |
| addCuePoint(aName:String, aTime:Number) : Void
Adds a new cue point to the display instance. |
| displayFull() : Void
Displays the player in full screen mode. |
| displayNormal() : Void
Displays the player in normal mode, as opposed to full screen mode. |
| draw() : Void
Updates the display and sizes the video object. |
| getCuePoint(pointName:String) : CuePoint
Gets a cue point name. |
| getCuePoints() : Array
Gets the Array of CuePoint objects that includes all the cue points associated with this object. |
| handleEvent(ev) : Void
Handles all the events broadcast by the MediaDisplay and MediaController controls. |
| hasPreferredHeight() : Boolean
Determines if the display has the preferred height. |
| hasPreferredWidth() : Boolean
Determines if the display has the preferred width. |
| init() : Void
Initializes the player. |
| load() : Void
Loads the media without playing it. |
| measure() : Void
Measures the display and sets the preferred sizes. |
| pause() : Void
Stops playback of the media without moving the playhead. |
| play(startingPoint:Number) : Void
Plays the media beginning at the specified starting point. |
| removeAllCuePoints() : Void
Remove all the cue points. |
| removeCuePoint(aCuePoint:CuePoint) : Void
Removes a cue point. |
| setCuePoints(cp:Array) : Void
Creates and populates an array of CuePoint objects. |
| setMedia(aUrl:String, aType:String) : Void
Sets the content path and the media type together. |
| stop() : Void
Stops playback of the media and resets the playhead to zero. |
| toString() : String
Creates the string representation of this object. |
| Methods inherited from class mx.core.View |
init
draw
createChild
getChildAt
getChildIndex
setChildIndex
destroyAllChildren
destroyChild
destroyChildAt
getViewMetrics
|
| Methods inherited from class mx.core.UIComponent |
getFocus
setFocus
getFocusManager
|
| Properties | |
static | version:String
MediaComponentVersion is for internal use only. |
| fps:Number
The frames per second is used only for video, and only in the configuration user interface. |
| autoSize:Boolean
[Read-Write]
If true, the display sizes itself according to the preferred size of the media. |
| aspectRatio:Boolean
[Read-Write]
Whether a MediaDisplay or MediaPlayback instance maintains the aspect ratio. |
| autoPlay:Boolean
[Read-Write]
Whether the media immediately begins to buffer and play. |
| playheadTime:Number
[Read-Write]
Playhead position, measured in seconds since beginning playing. |
| contentPath:String
[Read-Write]
Relative path and filename of the media to stream. |
| volume:Number
[Read-Write]
Volume setting, from 0 to 100. |
| playing:Boolean
[Read-Only]
Whether the media is currently playing. |
| preferredWidth:Number
[Read-Only]
Preferred width of the display. |
| preferredHeight:Number
[Read-Only]
Preferred height of the display. |
| bytesLoaded:Number
[Read-Only]
Number of bytes already loaded. |
| bytesTotal:Number
[Read-Only]
Total number of bytes to load. |
| 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 associated with this object. |
| mostRecentCuePoint:CuePoint
[Read-Only]
Read-only property that contains the most recently fired cue point. |
| mostRecentCuePointName:String
[Read-Only]
Read-only property that contains the name of 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. |
| controllerPolicy:String
[Read-Write]
Indicates how the controller behaves upon mouse interaction. |
| controlPlacement:String
[Read-Write]
Position of the controls relative to the display component. |
| Properties inherited from class mx.core.View |
version
className
numChildren
|
| Properties inherited from class mx.core.UIComponent |
version
enabled
tabIndex
|
| 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 | |
change | Broadcasts continuously while media is playing. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
progress | Broadcasts continuously while media is playing. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
cuePoint | Broadcasts when the value of a cue point`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. |
complete | Broadcasts 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. |
start | Broadcast when enough media has been buffered to begin playing. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
click | Broadcasts when the user clicks the Play/Pause button. The event object contains the property detail, which contains the string pause or play. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
playheadChange | Broadcasts when a user moves the playback slider or clicks the Go to Beginning or Go to End button. The event object contains the following property detail, which contains a number with the percent completed. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
volumeChange | Broadcasts when the user adjusts the volume. In MXML, use volumeChange as the property name. In ActionScript, use volume. The event object contains the following property detail, which contains an integer between 0 (minimum) and 100 (maximum) to indicate volume. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
| Events inherited from class: mx.core.View |
childCreated
childIndexChanged
childDestroyed
|
| Events inherited from class: mx.core.UIComponent |
focusIn
focusOut
keyDown
keyUp
show
hide
valid
invalid
valueCommitted
|
| Styles |
| Styles inherited from class mx.core.UIObject |
color
fontFamily
fontSize
fontStyle
fontWeight
textAlign
textDecoration
textIndent
marginLeft
marginRight
horizontalGap
verticalGap
|
| Constructor Detail |
MediaPlayback()
| Method Detail |
addCuePoint(aName:String, aTime:Number) : Void
Parameters
aName - Name of the cue point.
aTime - Time in the media where to add the cue point.
displayFull() : Void
displayNormal() : Void
draw() : Void
getCuePoint(pointName:String) : CuePoint
Parameters
pointName - The name of the cue point to find.
Returns
CuePoint associated with this object that has the given name.
getCuePoints() : Array
Returns
Array of CuePoint objects.
handleEvent(ev) : Void
Parameters
ev - Event.
hasPreferredHeight() : Boolean
hasPreferredWidth() : Boolean
init() : Void
load() : Void
measure() : Void
pause() : Void
play(startingPoint:Number) : Void
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() : Void
removeCuePoint(aCuePoint:CuePoint) : Void
Parameters
aCuePoint - Cue point to remove.
setCuePoints(cp:Array) : Void
Parameters
cp - Array of CuePoint objects.
setMedia(aUrl:String, aType:String) : Void
Parameters
aUrl -
aType - Media type.
stop() : Void
toString() : String
| Property Detail |
aspectRatio:Boolean
[Read-Write]
autoPlay:Boolean
[Read-Write]
autoSize:Boolean
[Read-Write]
bytesLoaded:Number
[Read-Only]
bytesTotal:Number
[Read-Only]
contentPath:String
[Read-Write]
controllerPolicy:String
[Read-Write]
controlPlacement:String
[Read-Write]
cuePoints:Array
[Read-Write]
fps:Number
mediaType:String
[Read-Write]
mostRecentCuePoint:CuePoint
[Read-Only]
mostRecentCuePointName:String
[Read-Only]
mostRecentCuePointTime:Number
[Read-Only]
playheadTime:Number
[Read-Write]
playing:Boolean
[Read-Only]
preferredHeight:Number
[Read-Only]
preferredWidth:Number
[Read-Only]
totalTime:Number
[Read-Write]
static version:String
volume:Number
[Read-Write]