MediaPlayback
| Kind of class: | class |
|---|---|
| Inherits from: | UIComponent < UIObject < MovieClip |
| Implements: | |
| Classpath: | mx.controls.MediaPlayback |
| File last modified: | Tuesday, 18 December 2007, 15:44:37 |
Summary
Constructor
Class properties
- symbolName : String
- symbolOwner : Object
- version : String
- TOP_CONTROL_POSITION : String
- BOTTOM_CONTROL_POSITION : String
- LEFT_CONTROL_POSITION : String
- RIGHT_CONTROL_POSITION : String
- H_BORDER : Number
- The horizontal border around the edge of the display
- V_BORDER : Number
Class properties inherited from UIComponent
Class properties inherited from UIObject
Instance properties
- className : String
- clipParameters : Object
- fps : Number
- The frames per second is only used for video, and is only used in
- _mediaType : String
- _contentPath : String
- _totalTime : Number
- _autoSize : Boolean
- _aspectRatio : Boolean
- _autoPlay : Boolean
- _controllerPolicy : String
- initCuePointNames : Array
- initCuePointTimes : Array
- _display : MediaDisplay
- _controller : MediaController
- _deadPreview : MovieClip
- _chrome : Chrome
- _controlPlacement : String
- The position of the controls relative to the display.
- _enabled : Boolean
- Is the component enabled?
- _settingMedia : Boolean
- Is the component in the middle of setting the media?
- autoSize : Boolean
- aspectRatio : Boolean
- autoPlay : Boolean
- playheadTime : Number
- contentPath : String
- volume : Number
- playing : Boolean
- preferredWidth : Number
- preferredHeight : Number
- bytesLoaded : Number
- bytesTotal : Number
- mediaType : String
- This should only be called to configure the component initially.
- totalTime : Number
- cuePoints : Array
- mostRecentCuePoint : CuePoint
- Retrieve the most recently fired cue point.
- mostRecentCuePointName : String
- Retrieve the most recently fired cue point name.
- mostRecentCuePointTime : Number
- Retrieve the most recently fired cue point time.
- controllerPolicy : String
- controlPlacement : String
- The position of the controls relative to the display component.
- enabled : Boolean
Instance properties inherited from UIComponent
Instance properties inherited from UIObject
__height __onUnload __width _color _endInit _id _maxHeight _maxWidth _minHeight _minWidth _preferredHeight _preferredWidth _tf _topmost addEventListener bottom buildDepthTable changeColorStyleInChildren changeTextStyleInChildren childrenCreated className clipParameters color createAccessibilityImplementation createChildAtDepth createClassChildAtDepth createEvent dispatchEvent embedFonts findNextAvailableDepth fontFamily fontSize fontStyle fontWeight handleEvent height idNames ignoreClassStyleDeclaration initProperties invalidateFlag left lineColor lineWidth marginLeft marginRight methodTable minHeight minWidth notifyStyleChangeInChildren removeEventListener right scaleX scaleY setStyle stylecache styleName tabEnabled textAlign textDecoration textIndent tfList top validateNow visible width x y
Class methods
Class methods inherited from UIObject
Instance methods
- init (Void) : Void
- Initialize the player.
- initializeParameters : Void
- Create default values for absent parameters
- draw (Void) : Void
- Draw the component.
- drawMP3 : Void
- drawFLV : Void
- drawChrome : Void
- drawFLVController : Void
- Position the controller for an FLV player.
- drawFLVDisplay : Void
- displaySetProperSize : Void
- handleEvent (ev) : Void
- Handle all the events broadcast by the display and controller
- toString : String
- getController : MediaController
- isRtmp (mediaUrl:String) : Boolean
- load : Void
- Load the media without playing it.
- play (startingPoint:Number) : Void
- Play the media starting at the specified starting point.
- pause : Void
- Stop playback of the media without moving the playhead.
- stop : Void
- Stop playback of the media and reset the playhead to zero.
- setMedia (aUrl:String, aType:String) : Void
- Set both the url and the type in a single call.
- getCuePoints : Array
- setCuePoints (cp:Array) : Void
- getCuePoint (pointName:String) : CuePoint
- addCuePoint (aName:String, aTime:Number) : Void
- Add the given cue point.
- addCuePointObject (aCuePoint:CuePoint) : Void
- Add the given cue point.
- removeCuePoint (aCuePoint:CuePoint) : Void
- Remove the given cue point.
- removeAllCuePoints : Void
- Remove all the CuePoints.
- addSecondChrome (theChrome:Chrome, closedHeight:Number, openHeight:Number, closedWidth:Number, openWidth:Number, fixedEnd:Boolean) : Void
- removeSecondChrome : Void
- getMinimumOpenHeight : Number
- getMinimumOpenWidth : Number
- getMinimumClosedHeight : Number
- getMinimumClosedWidth : Number
- expand (force:Boolean) : Void
- contract (force:Boolean) : Void
- isTopControlPlacement : Boolean
- isBottomControlPlacement : Boolean
- isLeftControlPlacement : Boolean
- isRightControlPlacement : Boolean
- displayFull : Void
- Display the player in full-screen mode.
- displayNormal : Void
- Display the player in normal mode (as opposed to full screen).
- setSize (w:Number, h:Number, noEvent:Boolean) : Void
- size the object
Instance methods inherited from UIObject__getTextFormat _createChildren _getTextFormat cancelAllDoLaters constructObject createChildren createClassObject createEmptyObject createLabel createObject createSkin destroyObject doLater doLaterDispatcher draw drawRect getClassStyleDeclaration getMinHeight getMinWidth getSkinIDName getStyle getStyleName init initFromClipParameters invalidate invalidateStyle move redraw setColor setMinHeight setMinWidth setSize setSkin setVisible sizeEvent handlersEvent handlers inherited from UIComponent - removeCuePoint (aCuePoint:CuePoint) : Void
Constructor
MediaPlayback
function MediaPlayback (
)
Constructor
Class properties
BOTTOM_CONTROL_POSITION
static private BOTTOM_CONTROL_POSITION:String = "bottom"
(read)
H_BORDER
static private H_BORDER:Number = 8
(read)
The horizontal border around the edge of the display
LEFT_CONTROL_POSITION
static private LEFT_CONTROL_POSITION:String = "left"
(read)
RIGHT_CONTROL_POSITION
static private RIGHT_CONTROL_POSITION:String = "right"
(read)
symbolName
static symbolName:String = "MediaPlayback"
(read)
symbolOwner
static symbolOwner:Object = mx.controls.MediaPlayback
(read)
TOP_CONTROL_POSITION
static private TOP_CONTROL_POSITION:String = "top"
(read)
V_BORDER
static private V_BORDER:Number = 8
(read)
version
static version:String = "2.0.2.126"
(read)
Instance properties
_aspectRatio
private _aspectRatio:Boolean
(read)
_autoPlay
private _autoPlay:Boolean
(read)
_autoSize
private _autoSize:Boolean
(read)
_chrome
_contentPath
private _contentPath:String
(read)
_controller
_controllerPolicy
private _controllerPolicy:String
(read)
_controlPlacement
private _controlPlacement:String
(read)
The position of the controls relative to the display.
top, bottom, left, or right.
top, bottom, left, or right.
_deadPreview
private _deadPreview:MovieClip
(read)
_display
_enabled
private _enabled:Boolean
(read)
Is the component enabled?
_mediaType
private _mediaType:String
(read)
_settingMedia
private _settingMedia:Boolean = false
(read)
Is the component in the middle of setting the media?
_totalTime
private _totalTime:Number
(read)
aspectRatio
aspectRatio:Boolean
(read,write)
Component metadata:
| Inspectable | defaultValue: true |
|---|
autoPlay
autoPlay:Boolean
(read,write)
Component metadata:
| Inspectable | defaultValue: true |
|---|
autoSize
autoSize:Boolean
(read,write)
Component metadata:
| Inspectable | defaultValue: true |
|---|
bytesLoaded
bytesLoaded:Number
(read)
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "progress" |
bytesTotal
bytesTotal:Number
(read)
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "start" |
className
className:String = "MediaPlayback"
(read)
clipParameters
clipParameters:Object = {}
(read)
contentPath
contentPath:String
(read,write)
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "start" |
| Inspectable | defaultValue: "" |
controllerPolicy
controllerPolicy:String
(read,write)
Parameters:
doHide:
True to hide the controller when the mouse is not
over it; false to not hide it.
over it; false to not hide it.
Component metadata:
| Inspectable | defaultValue: "auto" enumeration: "auto,on,off" |
|---|
controlPlacement
controlPlacement:String
(read,write)
The position of the controls relative to the display component.
Component metadata:
| Inspectable | defaultValue: "bottom" enumeration: "top,bottom,left,right" |
|---|
cuePoints
cuePoints:Array
(read,write)
Returns:
- An array of CuePoint objects. All the CuePoints associated
with this object.
enabled
enabled:Boolean
(read,write)
fps
fps:Number
(read)
The frames per second is only used for video, and is only used in
the configuration UI. The config UI uses it to calculate
milliseconds based on frame number.
the configuration UI. The config UI uses it to calculate
milliseconds based on frame number.
Component metadata:
| Inspectable | defaultValue: 30 |
|---|
initCuePointNames
initCuePointNames:Array
(read)
Component metadata:
| Inspectable |
|---|
initCuePointTimes
initCuePointTimes:Array
(read)
Component metadata:
| Inspectable |
|---|
mediaType
mediaType:String
(read,write)
This should only be called to configure the component initially.
It does not work at runtime.
It does not work at runtime.
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "start" |
| Inspectable | defaultValue: "FLV" enumeration: "FLV,MP3" |
mostRecentCuePoint
Retrieve the most recently fired cue point.
Unbindable since binding cannot handle structures.
Unbindable since binding cannot handle structures.
mostRecentCuePointName
mostRecentCuePointName:String
(read)
Retrieve the most recently fired cue point name.
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "cuePoint" |
mostRecentCuePointTime
mostRecentCuePointTime:Number
(read)
Retrieve the most recently fired cue point time.
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "cuePoint" |
playheadTime
playheadTime:Number
(read,write)
Returns:
- The playhead position, measued in seconds since the start.
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "change" |
playing
playing:Boolean
(read)
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "change" |
preferredHeight
preferredHeight:Number
(read)
preferredWidth
preferredWidth:Number
(read)
totalTime
totalTime:Number
(read,write)
Returns:
- The total time of the media. For mp3 files, this is a
property of the Sound object. For video, it is be a property
that is manually set by the author.
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "start" |
| Inspectable | defaultValue: 0 |
volume
volume:Number
(read,write)
Returns:
- The most recent volume setting
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "volume" |
Instance methods
addCuePoint
function addCuePoint (
aName:String,
aTime:Number) : Void
Add the given cue point.
Specified by:
addSecondChrome
function addSecondChrome (
theChrome:Chrome,
closedHeight:Number,
openHeight:Number,
closedWidth:Number,
openWidth:Number,
fixedEnd:Boolean) : Void
contract
function contract (
force:Boolean) : Void
displayFull
function displayFull (
) : Void
Display the player in full-screen mode. This makes the player
occupy the entire Flash stage. It does *not* change the size
of the Flash stage.
occupy the entire Flash stage. It does *not* change the size
of the Flash stage.
displayNormal
function displayNormal (
) : Void
Display the player in normal mode (as opposed to full screen).
The original size and position of the player are retained when it
toggles between full screen and normal mode.
The original size and position of the player are retained when it
toggles between full screen and normal mode.
displaySetProperSize
private function displaySetProperSize (
) : Void
draw
function draw (
Void) : Void
Draw the component. This is called upon initialization and when
the component is invalidated.
the component is invalidated.
Overrides:
drawChrome
private function drawChrome (
) : Void
drawFLV
private function drawFLV (
) : Void
drawFLVController
private function drawFLVController (
) : Void
Position the controller for an FLV player.
The placement is dictated by the controlPlacement member.
The placement is dictated by the controlPlacement member.
drawFLVDisplay
private function drawFLVDisplay (
) : Void
drawMP3
private function drawMP3 (
) : Void
expand
function expand (
force:Boolean) : Void
getController
getCuePoint
Parameters:
pointName:
The name of the cue point to find.
Returns:
- The CuePoint associated with this object that has the given
name.
Specified by:
getCuePoints
function getCuePoints (
) : Array
Returns:
- An array of CuePoint objects. All the CuePoints associated
with this object.
Specified by:
getMinimumClosedHeight
function getMinimumClosedHeight (
) : Number
getMinimumClosedWidth
function getMinimumClosedWidth (
) : Number
getMinimumOpenHeight
function getMinimumOpenHeight (
) : Number
getMinimumOpenWidth
function getMinimumOpenWidth (
) : Number
handleEvent
function handleEvent (
ev) : Void
Handle all the events broadcast by the display and controller
components. Rebroadcast them.
Special attention is paid to a "start" event from the display component.
This component will listen to see when playback of the media starts.
It will resize the video at that time.
components. Rebroadcast them.
Special attention is paid to a "start" event from the display component.
This component will listen to see when playback of the media starts.
It will resize the video at that time.
initializeParameters
private function initializeParameters (
) : Void
Create default values for absent parameters
isBottomControlPlacement
private function isBottomControlPlacement (
) : Boolean
isLeftControlPlacement
private function isLeftControlPlacement (
) : Boolean
isRightControlPlacement
private function isRightControlPlacement (
) : Boolean
isRtmp
function isRtmp (
mediaUrl:String) : Boolean
isTopControlPlacement
private function isTopControlPlacement (
) : Boolean
load
function load (
) : Void
Load the media without playing it.
pause
function pause (
) : Void
Stop playback of the media without moving the playhead.
play
function play (
startingPoint:Number) : Void
Play the media starting at the specified starting point. If the media
hasn't yet been loaded, load it.
hasn't yet been loaded, load it.
Parameters:
startingPoint:
The number of seconds into the media to start at.
This is an optional parameter. If omitted, playing will occur
at the current playhead position.
This is an optional parameter. If omitted, playing will occur
at the current playhead position.
removeAllCuePoints
function removeAllCuePoints (
) : Void
Remove all the CuePoints.
removeCuePoint
Remove the given cue point.
Parameters:
aCuePoint:
The CuePoint to remove.
removeSecondChrome
function removeSecondChrome (
) : Void
setCuePoints
function setCuePoints (
cp:Array) : Void
setMedia
function setMedia (
aUrl:String,
aType:String) : Void
Set both the url and the type in a single call.@tipText Associates the contentPath and mediaType to the MediaPlayback
stop
function stop (
) : Void
Stop playback of the media and reset the playhead to zero.
toString
function toString (
) : String
Returns:
- A string representation of this object