VideoPlayer

Kind of class:class
Inherits from:MovieClip
Classpath:mx.video.VideoPlayer
File last modified:Tuesday, 18 December 2007, 16:08:45

Event dispatched when NetConnection is closed,
whether by being timed out or by calling close() API.
Only dispatched with RTMP streams, never HTTP. Event Object has
properties state and playheadTime.

Component metadata:
    Event
    "close"

    Summary


    Constructor
    Instance properties
    Instance methods
    Event handlers
    • onMetaData (info:Object) : Void
      • handles NetStream.onMetaData callback
    • onCuePoint (info:Object) : Void
      • handles NetStream.onCuePoint callback

    Constructor

    VideoPlayer

    function VideoPlayer (
    )

    Constructor.

    Class properties

    AUTO_RESIZE_INTERVAL

    static private AUTO_RESIZE_INTERVAL:Number = 100
    (read)

    AUTO_RESIZE_METADATA_DELAY_MAX

    static private AUTO_RESIZE_METADATA_DELAY_MAX:Number = 5
    (read)

    AUTO_RESIZE_PLAYHEAD_TIMEOUT

    static private AUTO_RESIZE_PLAYHEAD_TIMEOUT = .5
    (read)

    BUFFER_EMPTY

    static private BUFFER_EMPTY:String = "bufferEmpty"
    (read)

    BUFFER_FLUSH

    static private BUFFER_FLUSH:String = "bufferFlush"
    (read)

    BUFFER_FULL

    static private BUFFER_FULL:String = "bufferFull"
    (read)

    BUFFERING

    static BUFFERING:String = "buffering"
    (read)

    State constant. State entered immediately after
    play() or load() is called.

    This is a responsive state.

    CLOSE_NS_INTERVAL

    static private CLOSE_NS_INTERVAL:Number = .25
    (read)

    CONNECTION_ERROR

    static CONNECTION_ERROR:String = "connectionError"
    (read)

    State constant. Stream attempted to load was unable to load
    for some reason. Could be no connection to server, stream not
    found, etc.

    This is a unresponsive state.

    DEFAULT_IDLE_TIMEOUT_INTERVAL

    static DEFAULT_IDLE_TIMEOUT_INTERVAL:Number = 300000
    (read)

    DEFAULT_INCMANAGER

    static DEFAULT_INCMANAGER:String = "mx.video.NCManager"
    (read)

    Set this property to the name of your custom class to
    make all VideoPlayer objects created use that class as the
    default INCManager implementation. The default value is
    "mx.video.NCManager".

    DEFAULT_UPDATE_PROGRESS_INTERVAL

    static DEFAULT_UPDATE_PROGRESS_INTERVAL:Number = 250
    (read)

    DEFAULT_UPDATE_TIME_INTERVAL

    static DEFAULT_UPDATE_TIME_INTERVAL:Number = 250
    (read)

    DISCONNECTED

    static DISCONNECTED:String = "disconnected"
    (read)

    State constant. This is the state when the VideoPlayer is
    constructed and when the stream is closed by a call to
    close() or timed out on idle.

    This is a responsive state.

    See also:

    EXEC_QUEUED_CMD

    static EXEC_QUEUED_CMD:String = "execQueuedCmd"
    (read)

    State constant. State during execution of queued command.
    There will never get a "stateChange" event notification with
    this state; it is internal only.

    This is a unresponsive state.

    FINISH_AUTO_RESIZE_INTERVAL

    static private FINISH_AUTO_RESIZE_INTERVAL:Number = 250
    (read)

    HTTP_DELAYED_BUFFERING_INTERVAL

    static private HTTP_DELAYED_BUFFERING_INTERVAL:Number = 100
    (read)

    HTTP_DO_SEEK_INTERVAL

    static private HTTP_DO_SEEK_INTERVAL:Number = 250
    (read)

    HTTP_DO_SEEK_MAX_COUNT

    static private HTTP_DO_SEEK_MAX_COUNT:Number = 4
    (read)

    LOAD

    static LOAD:Number = 1
    (read)

    LOADING

    static LOADING:String = "loading"
    (read)

    State constant. State entered immediately after
    play() or load() is called.

    This is a unresponsive state.

    PAUSE

    static PAUSE:Number = 2
    (read)

    PAUSED

    static PAUSED:String = "paused"
    (read)

    State constant. FLV is loaded, but play is paused.
    This state is entered when pause() is
    called or when load() is called.

    This is a responsive state.

    PLAY

    static PLAY:Number = 0
    (read)

    PLAYING

    static PLAYING:String = "playing"
    (read)

    State constant. FLV is loaded and is playing.
    This state is entered when play()is called.

    This is a responsive state.

    RESIZING

    static RESIZING:String = "resizing"
    (read)

    State constant. State entered during autoresize.

    This is a unresponsive state.

    See also:

    REWINDING

    static REWINDING:String = "rewinding"
    (read)

    State constant. State entered during a autorewind triggered
    by a stop. After rewind is complete, the state will be
    STOPPED.

    This is a unresponsive state.

    RTMP_DO_SEEK_INTERVAL

    static private RTMP_DO_SEEK_INTERVAL:Number = 100
    (read)

    RTMP_DO_STOP_AT_END_INTERVAL

    static private RTMP_DO_STOP_AT_END_INTERVAL:Number = 500
    (read)

    SEEK

    static SEEK:Number = 4
    (read)

    SEEKING

    static SEEKING:String = "seeking"
    (read)

    State constant. State entered after seek()is called.

    This is a unresponsive state.

    shortVersion

    static shortVersion:String = "1.0.2"
    (read)

    STOP

    static STOP:Number = 3
    (read)

    STOPPED

    static STOPPED:String = "stopped"
    (read)

    State constant. FLV is loaded and play is stopped. This state
    is entered when stop() is called and when the
    playhead reaches the end of the stream.

    This is a responsive state.

    version

    static version:String = "1.0.2.7"
    (read)

    Instance properties

    __visible

    private __visible:Boolean
    (read)

    _aspectRatio

    private _aspectRatio:Boolean
    (read)

    _atEnd

    private _atEnd:Boolean
    (read)

    _autoPlay

    private _autoPlay:Boolean
    (read)

    If true, then video plays immediately, if false waits for
    play to be called. Set to true if stream is
    loaded with call to play(), false if loaded
    by call to load().

    Even if _autoPlay is set to false, we will start
    loading the video after initialize() is called.
    In the case of FCS, this means creating the stream and loading
    the first frame to display (and loading more if
    autoSize or aspectRatio is true). In
    the case of HTTP download, we will start downloading the stream
    and show the first frame.

    _autoResizeDone

    private _autoResizeDone:Boolean
    (read)

    _autoResizeIntervalID

    private _autoResizeIntervalID:Number
    (read)

    _autoRewind

    private _autoRewind:Boolean
    (read)

    _autoSize

    private _autoSize:Boolean
    (read)

    _bufferState

    private _bufferState:String
    (read)

    _bufferTime

    private _bufferTime:Number
    (read)

    _cachedPlayheadTime

    private _cachedPlayheadTime:Number
    (read)

    _cachedState

    private _cachedState:String
    (read)

    _cmdQueue

    private _cmdQueue:Array
    (read)

    _contentPath

    private _contentPath:String
    (read)

    _currentPos

    private _currentPos:Number
    (read)

    _delayedBufferingInterval

    private _delayedBufferingInterval:Number
    (read)

    _delayedBufferingIntervalID

    private _delayedBufferingIntervalID:Number
    (read)

    _finishAutoResizeIntervalID

    private _finishAutoResizeIntervalID:Number
    (read)

    _hiddenForResize

    private _hiddenForResize:Boolean
    (read)

    _hiddenForResizeMetadataDelay

    private _hiddenForResizeMetadataDelay:Number
    (read)

    _hiddenRewindPlayheadTime

    private _hiddenRewindPlayheadTime:Number
    (read)

    _httpDoSeekCount

    private _httpDoSeekCount:Number
    (read)

    _httpDoSeekIntervalID

    private _httpDoSeekIntervalID:Number
    (read)

    _idleTimeoutInterval

    private _idleTimeoutInterval:Number
    (read)

    _idleTimeoutIntervalID

    private _idleTimeoutIntervalID:Number
    (read)

    _invalidSeekRecovery

    private _invalidSeekRecovery:Boolean
    (read)

    _invalidSeekTime

    private _invalidSeekTime:Boolean
    (read)

    _isLive

    private _isLive:Boolean
    (read)

    _lastUpdateTime

    private _lastUpdateTime:Number
    (read)

    _metadata

    private _metadata:Object
    (read)

    _ncMgr

    private _ncMgr:INCManager
    (read)

    _ns

    private _ns:NetStream
    (read)

    _prevVideoHeight

    private _prevVideoHeight:Number
    (read)

    _prevVideoWidth

    private _prevVideoWidth:Number
    (read)

    _readyDispatched

    private _readyDispatched:Boolean
    (read)

    _rtmpDoSeekIntervalID

    private _rtmpDoSeekIntervalID:Number
    (read)

    _rtmpDoStopAtEndIntervalID

    private _rtmpDoStopAtEndIntervalID:Number
    (read)

    _sawPlayStop

    private _sawPlayStop:Boolean
    (read)

    _sawSeekNotify

    private _sawSeekNotify:Boolean
    (read)

    _sound

    private _sound:Sound
    (read)

    _startingPlay

    private _startingPlay:Boolean
    (read)

    _state

    private _state:String
    (read)

    _streamLength

    private _streamLength:Number
    (read)

    _updateProgressInterval

    private _updateProgressInterval:Number
    (read)

    _updateProgressIntervalID

    private _updateProgressIntervalID:Number
    (read)

    _updateTimeInterval

    private _updateTimeInterval:Number
    (read)

    _updateTimeIntervalID

    private _updateTimeIntervalID:Number
    (read)

    _video

    private _video:Video
    (read)

    _videoHeight

    private _videoHeight:Number
    (read)

    _videoWidth

    private _videoWidth:Number
    (read)

    _volume

    private _volume:Number
    (read)

    addEventListener

    addEventListener:Function
    (read)

    autoRewind

    autoRewind:Boolean
    (read,write)

    Determines whether video aspect ratio is maintained. If
    this is set from false to true and

    autoSize</code is
    
    false after an FLV has been loaded, an automatic resize will
    start immediately.</p>

    @see #autoSize
    / public function get maintainAspectRatio():Boolean { return _aspectRatio; } public function set maintainAspectRatio(flag:Boolean):Void { if (_aspectRatio != flag) { _aspectRatio = flag; if (_aspectRatio && !_autoSize) { startAutoResize(); } } } /**
    <p>Determines whether the FLV is rewound to the first frame
    when play stops, either by calling <code>stop()
    or by
    reaching the end of the stream. Meaningless for live streams.

    autoSize

    autoSize:Boolean
    (read,write)

    Determines whether the instance is automatically resized to
    the source dimensions. If this is set from false to true after
    an FLV has been loaded, an automatic resize will start
    immediately.

    bufferTime

    bufferTime:Number
    (read,write)

    Sets number of seconds to buffer in memory before playing
    back stream. For slow connections streaming over rtmp, it is
    important to increase this from the default. Default is
    0.1

    bytesLoaded

    bytesLoaded:Number
    (read)

    property bytesLoaded, read only. Returns -1 when there
    is no stream, when the stream is FCS or if the information
    is not yet available. Return value only useful for HTTP
    download.

    bytesTotal

    bytesTotal:Number
    (read)

    property bytesTotal, read only. Returns -1 when there
    is no stream, when the stream is FCS or if the information
    is not yet available. Return value only useful for HTTP
    download.

    dispatchEvent

    dispatchEvent:Function
    (read)

    dispatchQueue

    dispatchQueue:Function
    (read)

    height

    height:Number
    (read,write)

    Height of video. Not same as Video.height, that is videoHeight.

    See also:

    idleTimeout

    idleTimeout:Number
    (read,write)

    Property idleTimeout, which is amount of time in
    milliseconds before connection is idle (playing is paused
    or stopped) before connection to the FCS server is
    terminated. Has no effect to HTTP download of FLV.

    If set when stream already idle, restarts idle timeout with
    new value.

    isLive

    isLive:Boolean
    (read)

    True if stream is live, read only. isLive only makes sense when
    streaming from FVSS or FCS, value is ignored when doing http
    download.

    isRTMP

    isRTMP:Boolean
    (read)

    True if stream is RTMP download (streaming from Flash
    Communication Server), read only.

    metadata

    metadata
    (read)

    Read only. Object received by call to onMetaData callback.
    null if onMetaData callback has not been called since the last
    load or play call. Always null with FLVs with no onMetaData
    packet.

    See also:

    ncMgr

    ncMgr:INCManager
    (read)

    Access to instance of the class implementing
    INCManager. Read only.

    One use case for this is that a custom
    INCManager implementation may require custom
    initialization.

    ncMgrClassName

    ncMgrClassName:String
    (read)

    playheadTime

    playheadTime:Number
    (read,write)

    The current playhead time in seconds. Setting does a seek
    and has all the restrictions of a seek.

    The event "playheadUpdate" is dispatched when the playhead
    time changes, including every .25 seconds while the FLV is
    playing.

    Returns:
    • The playhead position, measured in seconds since the start. Will return a fractional value.
    See also:

    playheadUpdateInterval

    playheadUpdateInterval:Number
    (read,write)

    Property playheadUpdateInterval, which is amount of time
    in milliseconds between each "playheadUpdate" event.

    If set when stream is playing, will restart interval.

    progressInterval

    progressInterval:Number
    (read,write)

    Property progressInterval, which is amount of time
    in milliseconds between each "progress" event.

    If set when stream is playing, will restart interval.

    removeEventListener

    removeEventListener:Function
    (read)

    scaleX

    scaleX:Number
    (read,write)

    100 is standard scale
    See also:

    scaleY

    scaleY:Number
    (read,write)

    100 is standard scale
    See also:

    state

    state:String
    (read)

    Get state. Read only. Set with load,
    play(), stop(),
    pause() and seek().

    stateResponsive

    stateResponsive:Boolean
    (read)

    Read only. Gets whether state is responsive. If state is
    unresponsive, calls to APIs play(),
    load(), stop(),
    pause() and seek() will queue the
    requests for later, when the state changes to a responsive
    one.

    totalTime

    totalTime:Number
    (read)

    property totalTime. read only. 0 or null or undefined
    means that property was not passed into play() or
    load() and was unable to detect automatically, or
    have not yet.

    Returns:
    • The total running time of the FLV in seconds

    transform

    transform:Object
    (read,write)

    Provides direct access to the
    Sound.setTransform() and
    Sound.getTransform() APIs. to expose more sound
    control. Must set property for changes to take effect, get
    property just to get a copy of the current settings to tweak.

    See also:

    url

    url:String
    (read)

    url of currently loaded (or loading) stream. Will be url
    last sent to play() or load(), nullif no stream is loaded.

    videoHeight

    videoHeight
    (read)

    Source height of loaded FLV file. Read only. Returns
    undefined if no information available yet.

    See also:

    videoWidth

    videoWidth
    (read)

    Source width of loaded FLV file. Read only. Returns
    undefined if no information available yet.

    See also:

    visible

    visible:Boolean
    (read,write)

    Use this instead of _visible because we
    sometimes do internal visibility management when doing an
    autoresize.

    volume

    volume:Number
    (read,write)

    Volume control in range from 0 to 100.

    Returns:
    • The most recent volume setting
    See also:

    width

    width:Number
    (read,write)

    Width of video instance. Not same as Video.width, that is videoWidth.

    See also:

    x

    x:Number
    (read,write)

    y

    y:Number
    (read,write)

    Instance methods

    _createStream

    private function _createStream (
    ) : Void

    Creates NetStream and does some basic
    initialization.

    _load

    private function _load (
    url:String, isLive:Boolean, totalTime:Number) : Void

    _pause

    private function _pause (
    doPause:Boolean) : Void

    Wrapper for NetStream.pause(). Never call
    NetStream.pause() directly, always call this
    method because it does some other housekeeping.

    _play

    private function _play (
    ) : Void

    Wrapper for NetStream.play(). Never call
    NetStream.play() directly, always call this
    method because it does some other housekeeping.

    _seek

    private function _seek (
    time:Number) : Void

    Wrapper for NetStream.seek(). Never call
    NetStream.seek() directly, always call
    this method because it does some other housekeeping.

    _setUpStream

    private function _setUpStream (
    ) : Void

    Does initialization after first connecting to the server
    and creating the stream. Will get the stream duration from
    the INCManager if it has it for us.

    Starts resize if necessary, otherwise starts playing if
    necessary, otherwise loads first frame of video. In http case,
    starts progressive download in any case.

    close

    function close (
    ) : Void

    Forces close of video stream and FCS connection. Triggers
    "close" event. Typically calling this directly is not necessary
    because the idle timeout functionality will take care of this.

    See also:
    • idleTimeout

    closeNS

    private function closeNS (
    updateCurrentPos:Boolean) : Void

    Wrapper for NetStream.close(). Never call
    NetStream.close() directly, always call this
    method because it does some other housekeeping.

    createINCManager

    private function createINCManager (
    ) : Void

    creates our implementatino of the INCManager.
    We put this off until we need to do it to give time for the
    user to customize the DEFAULT_INCMANAGERstatic variable.

    doAutoResize

    private function doAutoResize (
    ) : Void

    Does the actual work of resetting the width and height.

    Called on an interval which is stopped when width and height
    of the Video object are not zero. Finishing the
    resize is done in another method which is either called on a
    interval set up here for live streams or on a
    NetStream.Play.Stop event in rtmpOnStatus after
    stream is rewound if it is not a live stream. Still need to
    get a http solution.

    doDelayedBuffering

    private function doDelayedBuffering (
    ) : Void

    We do a brief timer before entering BUFFERING state to avoid
    quick switches from BUFFERING to PLAYING and back.

    doIdleTimeout

    private function doIdleTimeout (
    ) : Void

    ONLY CALL THIS WITH RTMP STREAMING

    Only used for rtmp connections. When we pause or stop,
    setup an interval to call this after a delay (see property
    idleTimeout). We do this to spare the server from
    having a bunch of extra xns hanging around, although this needs
    to be balanced with the load that creating connections puts on
    the server, and keep in mind that FCS can be configured to
    terminate idle connections on its own, which is a better way to
    manage the issue.

    doUpdateProgress

    public function doUpdateProgress (
    ) : Void

    Called at interval determined by
    progressInterval to send "progress" events.
    Object dispatch starts when _load is called, ends
    when all bytes downloaded or a network error of some kind
    occurs, dispatched every .25 seconds by default.

    doUpdateTime

    public function doUpdateTime (
    ) : Void

    Called on interval determined by
    playheadUpdateInterval to send "playheadUpdate"
    events. Events only sent when playhead is moving, sent every
    .25 seconds by default.

    execQueuedCmds

    private function execQueuedCmds (
    ) : Void

    Executes as many queued commands as possible, obviously
    stopping when state becomes unresponsive.

    finishAutoResize

    private function finishAutoResize (
    ) : Void

    Makes video visible, turns on sound and starts
    playing if live or autoplay.

    flushQueuedCmds

    private function flushQueuedCmds (
    ) : Void

    Dumps all queued commands without executing them

    httpDoSeek

    private function httpDoSeek (
    ) : Void

    ONLY CALL THIS WITH HTTP PROGRESSIVE DOWNLOAD

    If we get an onStatus callback indicating a seek is over,
    but the playheadTime has not updated yet, then we wait on a
    timer before moving forward.

    httpDoStopAtEnd

    private function httpDoStopAtEnd (
    ) : Void

    ONLY CALL THIS WITH HTTP PROGRESSIVE DOWNLOAD

    Call this when playing stops by hitting the end.

    httpOnStatus

    public function httpOnStatus (
    info:Object) : Void

    NetStream.onStatus callback for http. Handles
    autorewind.

    isXnOK

    private function isXnOK (
    ) : Boolean

    Gets whether connected to a stream. If not, then calls to APIs
    play() with no args, stop(),
    pause() and seek() will throw
    exceptions.
    See also:

    load

    function load (
    url:String, isLive:Boolean, totalTime:Number) : Void

    Similar to play, but causes the FLV to be loaded without
    playing. Autoresizing will occur if appropriate and the first
    frame of FLV will be shown (except for maybe not in the live case).
    After initial load and autoresize, state will be PAUSED.

    Takes same arguments as play(), but unlike that
    method it is never acceptable to call load() with
    no url. If you do, an Error will be thrown.

    If player is in an unresponsive state, queues the request.

    Parameters:
    url :
    Pass in a url string for the FLV you want to load.
    isLive :
    Pass in true if streaming a live feed from FCS.
    Defaults to false.
    totalTime:
    Pass in length of FLV. Pass in 0 or null or
    undefined to automatically detect length from metadata, server
    or xml. If INCManager.streamLength is not 0 or
    null or undefined when ncConnected is called, then
    that value will trump this one in any case. Default is
    undefined.
    See also:

    ncConnected

    function ncConnected (
    ) : Void

    Called by INCManager after when connection complete or
    failed after call to INCManager.connectToURL.
    If connection failed, set INCManager.nc = nullbefore calling.

    ncReconnected

    function ncReconnected (
    ) : Void

    Called by INCManager after when reconnection complete or
    failed after call to INCManager.reconnect. If
    connection failed, set INCManager.nc = nullbefore calling.

    pause

    function pause (
    ) : Void

    Pauses video playback. If video is paused or stopped, has
    no effect. To start playback again, call play().
    Takes no parameters

    If player is in an unresponsive state, queues the request.

    Throws an exception if called when no stream is
    connected. Use "stateChange" event and
    connected property to determine when it is
    safe to call this method.

    If state is already stopped, pause is does nothing and state
    remains stopped.

    See also:

    play

    function play (
    url:String, isLive:Boolean, totalTime:Number) : Void

    Causes the video to play. Can be called while the video is
    paused, stopped, or while the video is already playing. Call this
    method with no arguments to play an already loaded video or pass
    in a url to load a new stream.

    If player is in an unresponsive state, queues the request.

    Throws an exception if called with no args and no stream
    is connected. Use "stateChange" event and
    connected property to determine when it is
    safe to call this method.

    Parameters:
    url :
    Pass in a url string if you want to load and play a
    new FLV. If you have already loaded an FLV and want to continue
    playing it, pass in null.
    isLive :
    Pass in true if streaming a live feed from FCS.
    Defaults to false.
    totalTime:
    Pass in length of FLV. Pass in 0 or null or
    undefined to automatically detect length from metadata, server
    or xml. If INCManager.streamLength is not 0 or
    null or undefined when ncConnected is called, then
    that value will trump this one in any case. Default is
    undefined.
    See also:

    queueCmd

    private function queueCmd (
    type:Number, url:String, isLive:Boolean, time:Number) : Void

    rtmpDoSeek

    private function rtmpDoSeek (
    ) : Void

    ONLY CALL THIS WITH RTMP STREAMING

    Wait until time goes back to zero to leave rewinding state.

    rtmpDoStopAtEnd

    private function rtmpDoStopAtEnd (
    force:Boolean) : Void

    ONLY CALL THIS WITH RTMP STREAMING

    Has the logic for what to do when we decide we have come to
    a stop by coming to the end of an rtmp stream. There are a few
    different ways we decide this has happened, and we sometimes
    even set an interval that calls this function repeatedly to
    check if the time is still changing, which is why it has its
    own special function.

    rtmpOnStatus

    public function rtmpOnStatus (
    info:Object) : Void

    NetStream.onStatus callback for rtmp. Handles
    automatic resizing, autorewind and buffering messaging.

    seek

    function seek (
    time:Number) : Void

    Seeks to given second in video. If video is playing,
    continues playing from that point. If video is paused, seek to
    that point and remain paused. If video is stopped, seek to
    that point and enters paused state. Has no effect with live
    streams.

    If time is less than 0 or NaN, throws exeption. If time
    is past the end of the stream, or past the amount of file
    downloaded so far, then will attempt seek and when fails
    will recover.

    If player is in an unresponsive state, queues the request.

    Throws an exception if called when no stream is
    connected. Use "stateChange" event and
    connected property to determine when it is
    safe to call this method.

    Parameters:
    time:
    seconds
    Throws:
    See also:

    setScale

    function setScale (
    xs:Number, ys:Number)

    set scaleX and scaleY simultaneously. Since setting either
    one can trigger an autoresize, this can be better than invoking
    set width and set height individually.

    If autoSize is true then this has no effect, since the player
    sets its own dimensions. If maintainAspectRatio is true and
    autoSize is false, then changing scaleX or scaleY will trigger an
    autoresize.

    Parameters:
    scaleX:
     
    scaleY:
     
    See also:
    • scaleX
    • scaleY

    setSize

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

    set width and height simultaneously. Since setting either
    one can trigger an autoresize, this can be better than invoking
    set width and set height individually.

    If autoSize is true then this has no effect, since the player
    sets its own dimensions. If maintainAspectRatio is true and
    autoSize is false, then changing width or height will trigger
    an autoresize.

    Parameters:
    width :
     
    height:
     
    See also:
    • width
    • height

    setState

    private function setState (
    s:String) : Void

    sets state, dispatches event, execs queued commands. Always try to call
    this AFTER you do your work, because the state might change again after
    you call this if you set it to a responsive state becasue of the call
    to exec queued commands. If you set this to a responsive state and
    then do more state based logic, check _state to make sure it did not
    change out from under you.

    setStateFromCachedState

    private function setStateFromCachedState (
    ) : Void

    Sets state to _cachedState if the _cachedState is PLAYING,
    PAUSED or BUFFERING, otherwise sets state to STOPPED.

    startAutoResize

    private function startAutoResize (
    )

    Kicks off autoresize process

    stop

    function stop (
    ) : Void

    Stops video playback. If autoRewind is set to
    true, rewinds to first frame. If video is already
    stopped, has no effect. To start playback again, call
    play(). Takes no parameters

    If player is in an unresponsive state, queues the request.

    Throws an exception if called when no stream is
    connected. Use "stateChange" event and
    connected property to determine when it is
    safe to call this method.

    See also:

    Event handlers

    onCuePoint

    public function onCuePoint (
    info:Object) : Void

    handles NetStream.onCuePoint callback

    onMetaData

    public function onMetaData (
    info:Object) : Void

    handles NetStream.onMetaData callback