Class mx.controls.MediaPlayback

MovieClip
   +--mx.core.UIObject
      +--mx.core.UIComponent
         +--mx.controls.MediaPlayback

Implemented Interfaces

ICuePointHolder

Description

MediaPlayback is a full-featured displayer and controller of streaming media. It plays FLV and MP3 files.

Field Index

_aspectRatio, _autoPlay, _autoSize, _chrome, _contentPath, _controller, _controllerPolicy, _controlPlacement, _deadPreview, _display, _enabled, _mediaType, _settingMedia, _totalTime, aspectRatio, autoPlay, autoSize, BOTTOM_CONTROL_POSITION, bytesLoaded, bytesTotal, className, clipParameters, contentPath, controllerPolicy, controlPlacement, cuePoints, enabled, fps, H_BORDER, initCuePointNames, initCuePointTimes, LEFT_CONTROL_POSITION, mediaType, mostRecentCuePoint, mostRecentCuePointName, mostRecentCuePointTime, playheadTime, playing, preferredHeight, preferredWidth, RIGHT_CONTROL_POSITION, symbolName, symbolOwner, TOP_CONTROL_POSITION, totalTime, V_BORDER, volume
Inherited from UIComponent
clipParameters, drawFocus, enabled, focusEnabled, focusManager, focusTextField, groupName, height, kStretch, mergedClipParameters, origBorderStyles, origBorderValues, popUp, symbolName, symbolOwner, tabEnabled, tabIndex, width
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, symbolName, symbolOwner, tabEnabled, textAlign, textColorList, textDecoration, textIndent, tfList, top, validateNow, visible, width, x, y
Inherited from MovieClip
_alpha, _currentframe, _droptarget, _focusrect, _framesloaded, _height, _lockroot, _name, _parent, _quality, _rotation, _soundbuftime, _target, _totalframes, _url, _visible, _width, _x, _xmouse, _xscale, _y, _ymouse, _yscale, enabled, focusEnabled, hitArea, tabChildren, tabEnabled, tabIndex, tooltipText, trackAsMenu, useHandCursor

Method Index

new MediaPlayback()

addCuePoint(), addCuePointObject(), addSecondChrome(), contract(), displayFull(), displayNormal(), displaySetProperSize(), draw(), drawChrome(), drawFLV(), drawFLVController(), drawFLVDisplay(), drawMP3(), expand(), getController(), getCuePoint(), getCuePoints(), getMinimumClosedHeight(), getMinimumClosedWidth(), getMinimumOpenHeight(), getMinimumOpenWidth(), handleEvent(), init(), initializeParameters(), isBottomControlPlacement(), isLeftControlPlacement(), isRightControlPlacement(), isRtmp(), isTopControlPlacement(), load(), pause(), play(), removeAllCuePoints(), removeCuePoint(), removeSecondChrome(), setCuePoints(), setMedia(), setSize(), stop(), toString()
Inherited from UIComponent
dispatchValueChangedEvent(), enabledChanged(), findFocusFromObject(), findFocusInChildren(), getFocus(), getFocusManager(), isParent(), onKillFocus(), onSetFocus(), pressFocus(), releaseFocus(), setEnabled(), setFocus(), setVisible(), size()
Inherited from UIObject
__getTextFormat(), _createChildren(), _getTextFormat(), cancelAllDoLaters(), constructObject(), createChildren(), createClassObject(), createEmptyObject(), createLabel(), createObject(), createSkin(), destroyObject(), doLater(), doLaterDispatcher(), drawRect(), getClassStyleDeclaration(), getMinHeight(), getMinWidth(), getSkinIDName(), getStyle(), getStyleName(), initFromClipParameters(), invalidate(), invalidateStyle(), mergeClipParameters(), move(), redraw(), setColor(), setMinHeight(), setMinWidth(), setSkin()
Inherited from MovieClip
attachAudio(), attachMovie(), beginFill(), beginGradientFill(), clear(), createEmptyMovieClip(), createTextField(), curveTo(), duplicateMovieClip(), endFill(), getBounds(), getBytesLoaded(), getBytesTotal(), getDepth(), getInstanceAtDepth(), getNextHighestDepth(), getSWFVersion(), getTextSnapshot(), getURL(), globalToLocal(), gotoAndPlay(), gotoAndStop(), hitTest(), lineStyle(), lineTo(), loadMovie(), loadVariables(), localToGlobal(), moveTo(), nextFrame(), onData(), onDragOut(), onDragOver(), onEnterFrame(), onKeyDown(), onKeyUp(), onLoad(), onMouseDown(), onMouseMove(), onMouseUp(), onPress(), onRelease(), onReleaseOutside(), onRollOut(), onRollOver(), onUnload(), prevFrame(), removeMovieClip(), setMask(), startDrag(), stopDrag(), swapDepths(), unloadMovie(), valueOf()

Constructor Detail

MediaPlayback

public function MediaPlayback()
Constructor

Field Detail

symbolName

static symbolName:String

symbolOwner

static symbolOwner:Object

className

className:String

clipParameters

clipParameters:Object

TOP_CONTROL_POSITION

static private TOP_CONTROL_POSITION:String

BOTTOM_CONTROL_POSITION

static private BOTTOM_CONTROL_POSITION:String

LEFT_CONTROL_POSITION

static private LEFT_CONTROL_POSITION:String

RIGHT_CONTROL_POSITION

static private RIGHT_CONTROL_POSITION:String

H_BORDER

static private H_BORDER:Number

V_BORDER

static private V_BORDER:Number

fps

public fps:Number

_mediaType

private _mediaType:String

_contentPath

private _contentPath:String

_totalTime

private _totalTime:Number

_autoSize

private _autoSize:Boolean

_aspectRatio

private _aspectRatio:Boolean

_autoPlay

private _autoPlay:Boolean

_controllerPolicy

private _controllerPolicy:String

initCuePointNames

public initCuePointNames:Array

initCuePointTimes

public initCuePointTimes:Array

_display

private _display:MediaDisplay

_controller

private _controller:MediaController

_deadPreview

private _deadPreview:MovieClip

_chrome

private _chrome:Chrome

_controlPlacement

private _controlPlacement:String

_enabled

private _enabled:Boolean

_settingMedia

private _settingMedia:Boolean

autoSize

public autoSize:Boolean

aspectRatio

public aspectRatio:Boolean

autoPlay

public autoPlay:Boolean

playheadTime

public playheadTime:Number

contentPath

public contentPath:String

volume

public volume:Number

playing

public playing:Boolean [Read Only]

preferredWidth

public preferredWidth:Number [Read Only]

preferredHeight

public preferredHeight:Number [Read Only]

bytesLoaded

public bytesLoaded:Number [Read Only]

bytesTotal

public bytesTotal:Number [Read Only]

mediaType

public mediaType:String

totalTime

public totalTime:Number

cuePoints

public cuePoints:Array

mostRecentCuePoint

public mostRecentCuePoint:CuePoint [Read Only]
Retrieve the most recently fired cue point. Unbindable since binding cannot handle structures.

mostRecentCuePointName

public mostRecentCuePointName:String [Read Only]
Retrieve the most recently fired cue point name.

mostRecentCuePointTime

public mostRecentCuePointTime:Number [Read Only]
Retrieve the most recently fired cue point time.

controllerPolicy

public controllerPolicy:String

controlPlacement

public controlPlacement:String
The position of the controls relative to the display component.

enabled

public enabled:Boolean

Method Detail

init

function init(Void):Void
Initialize the player.

initializeParameters

private function initializeParameters():Void
Create default values for absent parameters

draw

function draw(Void):Void
Draw the component. This is called upon initialization and when the component is invalidated.

drawMP3

private function drawMP3():Void

drawFLV

private function drawFLV():Void

drawChrome

private function drawChrome():Void

drawFLVController

private function drawFLVController():Void
Position the controller for an FLV player. The placement is dictated by the controlPlacement member.

drawFLVDisplay

private function drawFLVDisplay():Void

displaySetProperSize

private function displaySetProperSize():Void

handleEvent

public 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.

toString

public function toString():
String
Return
A string representation of this object

getController

public function getController():
MediaController

isRtmp

public function isRtmp(mediaUrl:
String):Boolean

load

public function load():Void
Load the media without playing it.

play

public function play(startingPoint:
Number):Void
Play the media starting at the specified starting point. If the media 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. @tiptext Plays the media from the given starting point @helpid 3476

pause

public function pause():Void
Stop playback of the media without moving the playhead.

stop

public function stop():Void
Stop playback of the media and reset the playhead to zero.

setMedia

public function setMedia(aUrl:
String, aType:String):Void
Set both the url and the type in a single call.

getCuePoints

public function getCuePoints():
Array
Return
An array of CuePoint objects. All the CuePoints associated with this object. @tiptext Returns the cuePoint object @helpid 3474

setCuePoints

public function setCuePoints(cp:
Array):Void

getCuePoint

public function getCuePoint(pointName:
String):CuePoint
Parameters
pointName The name of the cue point to find.
Return
The CuePoint associated with this object that has the given name.

addCuePoint

public function addCuePoint(aName:
String, aTime:Number):Void
Add the given cue point.
Parameters

addCuePointObject

public function addCuePointObject(aCuePoint:
CuePoint):Void

removeCuePoint

public function removeCuePoint(aCuePoint:
CuePoint):Void
Remove the given cue point.
Parameters
aCuePoint The CuePoint to remove. @tiptext Delete a specific cuepoint associated with this instance @helpid 3479

removeAllCuePoints

public function removeAllCuePoints():Void
Remove all the CuePoints.

addSecondChrome

public function addSecondChrome(theChrome:
Chrome, closedHeight:Number, openHeight:Number, closedWidth:Number, openWidth:Number, fixedEnd:Boolean):Void

removeSecondChrome

public function removeSecondChrome():Void

getMinimumOpenHeight

public function getMinimumOpenHeight():
Number

getMinimumOpenWidth

public function getMinimumOpenWidth():
Number

getMinimumClosedHeight

public function getMinimumClosedHeight():
Number

getMinimumClosedWidth

public function getMinimumClosedWidth():
Number

expand

public function expand(force:
Boolean):Void

contract

public function contract(force:
Boolean):Void

isTopControlPlacement

private function isTopControlPlacement():
Boolean

isBottomControlPlacement

private function isBottomControlPlacement():
Boolean

isLeftControlPlacement

private function isLeftControlPlacement():
Boolean

isRightControlPlacement

private function isRightControlPlacement():
Boolean

displayFull

public 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.

displayNormal

public 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.

setSize

public function setSize(w:
Number, h:Number, noEvent:Boolean):Void