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
Instance properties
Class methods
Class methods inherited from UIObject
Instance methods
Event handlers
Event handlers inherited from UIComponent

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

private _chrome:Chrome
(read)

_contentPath

private _contentPath:String
(read)

_controller

private _controller:MediaController
(read)

_controllerPolicy

private _controllerPolicy:String
(read)

_controlPlacement

private _controlPlacement:String
(read)

The position of the controls relative to the display.
top, bottom, left, or right.

_deadPreview

private _deadPreview:MovieClip
(read)

_display

private _display:MediaDisplay
(read)

_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.
              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.
                  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.
                        Component metadata:
                          Bindable
                          ChangeEvent
                          "start"
                          Inspectable
                          defaultValue:
                          "FLV"
                          enumeration:
                          "FLV,MP3"

                          mostRecentCuePoint

                          mostRecentCuePoint:CuePoint
                          (read)

                          Retrieve the most recently fired cue point.
                          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.
                                      Parameters:
                                      aCuePoint:
                                      The CuePoint to add.
                                      aName :
                                      The name of the CuePoint to add.
                                      #
                                      aTime :
                                      The time of the CuePoint to add.
                                      #

                                      addCuePointObject

                                      function addCuePointObject (
                                      aCuePoint:CuePoint) : Void

                                      Add the given cue point.
                                      #
                                      Parameters:
                                      aCuePoint:
                                      The CuePoint to add.
                                      #

                                      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.

                                      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.

                                      displaySetProperSize

                                      private function displaySetProperSize (
                                      ) : Void

                                      draw

                                      function draw (
                                      Void) : Void

                                      Draw the component. This is called upon initialization and when
                                      the component is invalidated.

                                      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.

                                      drawFLVDisplay

                                      private function drawFLVDisplay (
                                      ) : Void

                                      drawMP3

                                      private function drawMP3 (
                                      ) : Void

                                      expand

                                      function expand (
                                      force:Boolean) : Void

                                      getController

                                      function getController (

                                      getCuePoint

                                      function getCuePoint (
                                      pointName:String) : CuePoint

                                      Parameters:
                                      pointName:
                                      The name of the cue point to find.
                                      Returns:
                                      • The CuePoint associated with this object that has the given
                                        name.

                                      getCuePoints

                                      function getCuePoints (
                                      ) : Array

                                      Returns:
                                      • An array of CuePoint objects. All the CuePoints associated
                                        with this object.

                                      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.

                                      init

                                      function init (
                                      Void) : Void

                                      Initialize the player.

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

                                      removeAllCuePoints

                                      function removeAllCuePoints (
                                      ) : Void

                                      Remove all the CuePoints.

                                      removeCuePoint

                                      function removeCuePoint (
                                      aCuePoint:CuePoint) : Void

                                      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

                                      setSize

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

                                      size the object
                                      #
                                      Parameters:
                                      w :
                                      width of the object
                                      #
                                      h :
                                      height of the object
                                      #
                                      noEvent:
                                      if true, doesn't broadcast "resize" event
                                      #

                                      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