Class mx.controls.MediaDisplay

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

Implemented Interfaces

ICuePointHolder

Description

MediaDisplay plays FLV and MP3 files.

Field Index

_aspectRatio, _autoPlay, _autoSize, _contentPath, _cuePoints, _deadPreview, _enabled, _fireCuePoints, _fullyLoaded, _mediaType, _mostRecentCuePoint, _playerImpl, _playingBeforeDisabled, _pollId, _priorBytesLoaded, _priorTime, _processor, _screenAccommodator, _scrubbing, _sendCompleteEvent, _soundHolder, _started, _startingTime, _toggleControl, _totalTime, _videoHolder, aspectRatio, autoPlay, autoSize, bytesLoaded, bytesTotal, className, clipParameters, contentPath, cuePoints, enabled, fps, initCuePointNames, initCuePointTimes, makeVideoVisible, mediaType, mostRecentCuePoint, mostRecentCuePointName, mostRecentCuePointTime, playheadTime, playing, preferredHeight, preferredWidth, symbolName, symbolOwner, totalTime, videoHeight, videoWidth, 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 MediaDisplay()

addCuePoint(), addCuePointObject(), assignPreferredSize(), associateController(), deduceMediaType(), draw(), getCuePoint(), getCuePointIndex(), getCuePoints(), handleEvent(), handleFastForwardEvent(), handlePauseEvent(), handlePlayer(), handlePlayEvent(), handlePlayheadChangeEvent(), handleRewindEvent(), handleScrubbingEvent(), handleStopEvent(), handleUnrecognizedEvent(), handleVolumeEvent(), init(), initCuePoints(), initializeParameters(), initMedia(), isFLV(), isLivePreview(), isMP3(), isRtmp(), load(), onUnload(), pause(), play(), poll(), releaseVideo(), removeAllCuePoints(), removeCuePoint(), setCuePoints(), setMedia(), setSize(), setVideoDisplaySize(), 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(), prevFrame(), removeMovieClip(), setMask(), startDrag(), stopDrag(), swapDepths(), unloadMovie(), valueOf()

Constructor Detail

MediaDisplay

public function MediaDisplay()
Constructor

Field Detail

symbolName

static symbolName:String

symbolOwner

static symbolOwner:Object

className

className:String

clipParameters

clipParameters:Object

fps

public fps:Number

initCuePointNames

public initCuePointNames:Array

initCuePointTimes

public initCuePointTimes:Array

_contentPath

private _contentPath:String

_mediaType

private _mediaType:String

_autoSize

private _autoSize:Boolean

_aspectRatio

private _aspectRatio:Boolean

_autoPlay

private _autoPlay:Boolean

_deadPreview

private _deadPreview:MovieClip

_toggleControl

private _toggleControl:FullScreenToggle

_playerImpl

private _playerImpl:IPlayer

_videoHolder

private _videoHolder:MovieClip

_soundHolder

private _soundHolder:MovieClip

_processor

private _processor:MovieClip

_priorTime

private _priorTime:Number

_priorBytesLoaded

private _priorBytesLoaded:Number

_cuePoints

private _cuePoints:Array

_mostRecentCuePoint

private _mostRecentCuePoint

_scrubbing

private _scrubbing:Boolean

_fireCuePoints

private _fireCuePoints:Boolean

_startingTime

private _startingTime:Number

_totalTime

private _totalTime:Number

_started

private _started:Boolean

_sendCompleteEvent

private _sendCompleteEvent:Boolean

_fullyLoaded

private _fullyLoaded:Boolean

_enabled

private _enabled:Boolean

_playingBeforeDisabled

private _playingBeforeDisabled:Boolean

_pollId

private _pollId:Number

makeVideoVisible

public makeVideoVisible:Boolean

_screenAccommodator

private _screenAccommodator:ScreenAccommodator

videoWidth

public videoWidth:Number [Read Only]

videoHeight

public videoHeight:Number [Read Only]

preferredWidth

public preferredWidth:Number [Read Only]

preferredHeight

public preferredHeight:Number [Read Only]

autoSize

public autoSize:Boolean

aspectRatio

public aspectRatio:Boolean

autoPlay

public autoPlay:Boolean
Autoplay is strictly an initialization parameter.

playheadTime

public playheadTime:Number

contentPath

public contentPath:String
Create a contentPath property.

volume

public volume:Number

playing

public playing:Boolean [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]

mostRecentCuePointTime

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

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

initCuePoints

private function initCuePoints():Void
Initialize the cue points from the init parameters. The data from the initCuePointNames and initCuePointTimes arrays will be consolidated into the single _cuePoints array.

initMedia

public function initMedia(switchType:
Boolean):Void
Prepare the component for the media and load it.
Parameters
switchType Switch to a new media type. OPTIONAL

draw

public function draw():Void
Update the display -- size the video object. Don't do anything for mp3 media.

setVideoDisplaySize

private function setVideoDisplaySize(w:
Number, h:Number):Void
Parameters
w The new width of the component
h The new height of the component

assignPreferredSize

public function assignPreferredSize():Void

handlePlayer

public function handlePlayer(player:
IPlayer, status:String)
Handle events broadcast by the player implementation.

toString

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

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)
Set both the content path and the media type together.

deduceMediaType

private function deduceMediaType(aUrl:
String):String

releaseVideo

private function releaseVideo():Void
Completely release the video from the display. This is trickier than it might seem. Incompletely releasing the video leads to problems. If the same FLV is subsequently reloaded and its video or audio is already attached to the movie, the NetStream.play() call will fail.

isLivePreview

private function isLivePreview():
Boolean
Return
True if we are in live preview; false if not.

isFLV

private function isFLV():
Boolean
Convenience function for internal use only

isMP3

private function isMP3():
Boolean
Convenience function for internal use only

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
An array of cue point objects

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
Add the given cue point.
Parameters
aCuePoint The CuePoint to add.

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.

handleEvent

public function handleEvent(ev:
Object):Void
Listen to events from the controller. The following events are actually propogated: click, playheadChange, volume. The others included below were available during development but are not now.

handlePlayEvent

private function handlePlayEvent(ev:
Object):Void
Handle a click on the play button

handleStopEvent

private function handleStopEvent(ev:
Object):Void
Handle a click on the stop button

handlePauseEvent

private function handlePauseEvent(ev:
Object):Void
Handle a click on the pause button

handleRewindEvent

private function handleRewindEvent(ev:
Object):Void
Handle a click on the rewind button

handleFastForwardEvent

private function handleFastForwardEvent(ev:
Object):Void
Handle a click on the fast forward button

handlePlayheadChangeEvent

private function handlePlayheadChangeEvent(ev:
Object):Void
Handle a new playhead position event

handleVolumeEvent

private function handleVolumeEvent(ev:
Object):Void
Handle a volume event

handleScrubbingEvent

private function handleScrubbingEvent(ev:
Object):Void
Handle a scrubbing event

handleUnrecognizedEvent

private function handleUnrecognizedEvent(ev:
Object):Void
Handle an unrecognized event

getCuePointIndex

private function getCuePointIndex(pointName:
String):Number
Return
The index of the cue point with given name, or -1 if not found.

poll

private function poll(first:
Boolean):Void
Monitor the current status of the component.
Parameters
first True if this is the first time poll is being called.

isRtmp

public function isRtmp(mediaUrl:
String):Boolean

associateController

public function associateController(c:
MediaController):Void
Associated this display with a controller. Set up the event listeners between the two.

setSize

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

onUnload

public function onUnload():Void
Make sure media playing stops when we unload the clip.