FLVPlayback
| Kind of class: | class |
|---|---|
| Inherits from: | MovieClip |
| Classpath: | mx.video.FLVPlayback |
| File last modified: | Tuesday, 18 December 2007, 16:09:31 |
Event dispatched when FLVPlayback.BUFFERING state
entered. This state is typically entered immediately afterplay() is called or the corresponding control is
clicked, before the playing state is entered. Event Object has
properties state and playheadTime.
Event has property vp, index number of VideoPlayer to which this
event applies. See activeVideoPlayerIndex and visibleVideoPlayerIndex.
"stateChange" event will also be dispatched.
Summary
- version : String
- shortVersion : String
- DISCONNECTED : String
- STOPPED : String
- PLAYING : String
- PAUSED : String
- BUFFERING : String
- LOADING : String
- CONNECTION_ERROR : String
- REWINDING : String
- SEEKING : String
- ALL
- EVENT
- NAVIGATION
- FLV
- ACTIONSCRIPT
- VP_DEPTH_OFFSET : Number
- SEEK_TO_PREV_OFFSET_DEFAULT : Number
- boundingBox_mc : MovieClip
- bounding box movie clip inside of component on stage
- preview_mc : MovieClip
- _vp : Array
- _vpState : Array
- _activeVP : Number
- _visibleVP : Number
- _topVP : Number
- _uiMgr : UIManager
- _cpMgr : Array
- _preSeekTime : Number
- _firstStreamReady : Boolean
- _firstStreamShown : Boolean
- _autoPlay : Boolean
- _autoRewind : Boolean
- _autoSize : Boolean
- _bufferTime : Number
- _contentPath : String
- _cuePoints : Array
- _idleTimeout : Number
- _isLive : Boolean
- _aspectRatio : Boolean
- _playheadUpdateInterval : Number
- _progressInterval : Number
- _origWidth : Number
- _origHeight : Number
- _scaleX : Number
- _scaleY : Number
- _seekToPrevOffset : Number
- _totalTime : Number
- _transform : Object
- _volume : Number
- __height : Number
- __width : Number
- _backButton : MovieClip
- _bufferingBar : MovieClip
- _bufferingBarHides : Boolean
- _forwardButton : MovieClip
- _pauseButton : MovieClip
- _playButton : MovieClip
- _playPauseButton : MovieClip
- _seekBar : MovieClip
- _seekBarInterval : Number
- _seekBarScrubTolerance : Number
- _skin : String
- _skinAutoHide : Boolean
- _stopButton : MovieClip
- _muteButton : MovieClip
- _volumeBar : MovieClip
- _volumeBarInterval : Number
- _volumeBarScrubTolerance : Number
- addEventListener : Function
- removeEventListener : Function
- dispatchEvent : Function
- dispatchQueue : Function
- __forceNCMgr : NCManager
- playheadPercentage : Number
- activeVideoPlayerIndex : Number
- autoPlay : Boolean
- autoRewind : Boolean
- autoSize : Boolean
- bitrate : Number
- buffering : Boolean
- If state is buffering.
- bufferingBar : MovieClip
- bufferingBarHidesAndDisablesOthers : Boolean
- backButton : MovieClip
- bufferTime : Number
- bytesLoaded : Number
- bytesTotal : Number
- contentPath : String
- cuePoints (cp:Array) : Array
- forwardButton : MovieClip
- height : Number
- idleTimeout : Number
- isRTMP : Boolean
- True if stream is RTMP download (streaming from Flash
- isLive : Boolean
- maintainAspectRatio : Boolean
- metadata : Object
- metadataLoaded : Boolean
- muteButton : MovieClip
- ncMgr : INCManager
- pauseButton : MovieClip
- paused : Boolean
- If state is paused.
- playButton : MovieClip
- playheadTime : Number
- playheadUpdateInterval : Number
- playing : Boolean
- If state is playing.
- playPauseButton : MovieClip
- preferredHeight : Number
- preferredWidth : Number
- progressInterval : Number
- scaleX : Number
- 100 is standard scale
- scaleY : Number
- 100 is standard scale
- scrubbing : Boolean
- seekBar : MovieClip
- seekBarInterval : Number
- Determines how often check the seek bar handle location when
- seekBarScrubTolerance : Number
- seekToPrevOffset : Number
- skin : String
- skinAutoHide : Boolean
- transform : Object
- state : String
- stateResponsive : Boolean
- stopButton : MovieClip
- stopped : Boolean
- If state is stopped.
- totalTime : Number
- version_1_0_2 : String
- read only, only included to appear in the CI
- visible : Boolean
- visibleVideoPlayerIndex : Number
- volume : Number
- volumeBar : MovieClip
- volumeBarInterval : Number
- Determines how often check the volume bar handle location
- volumeBarScrubTolerance : Number
- width : Number
- x : Number
- y : Number
- setSize (w:Number, h:Number) : Void
- setScale (xs:Number, ys:Number)
- handleEvent (e:Object) : Void
- handles events
- load (contentPath:String, totalTime:Number, isLive:Boolean) : Void
- play (contentPath:String, totalTime:Number, isLive:Boolean) : Void
- pause : Void
- pause
- stop : Void
- stop
- seek (time:Number) : Void
- seekSeconds (time:Number) : Void
- seekPercent (percent:Number) : Void
- seekToNavCuePoint (timeNameOrCuePoint:Object) : Void
- seekToNextNavCuePoint (time:Number) : Void
- seekToPrevNavCuePoint (time:Number) : Void
- addASCuePoint (timeOrCuePoint:Object, name:String, parameters:Object) : Number
- removeASCuePoint (timeNameOrCuePoint:Object) : Object
- findCuePoint (timeNameOrCuePoint:Object, type:String) : Object
- findNearestCuePoint (timeNameOrCuePoint:Object, type:String) : Object
- findNextCuePointWithName (cuePoint:Object) : Object
- setFLVCuePointEnabled (enabled:Boolean, timeNameOrCuePoint:Object) : Number
- isFLVCuePointEnabled (timeNameOrCuePoint:Object) : Boolean
- getNextHighestDepth : Number
- Override MovieClip functionality to reserve depths less than
- bringVideoPlayerToFront (index:Number) : Void
- Brings VideoPlayer to the front of the stack of VideoPlayers.
- getVideoPlayer (index:Number) : VideoPlayer
- Get VideoPlayer with given index.
- closeVideoPlayer (index:Number) : VideoPlayer
- Close VideoPlayer with given index.
- createVideoPlayer (index:Number) : Void
- Creates and configures VideoPlayer movie clip
- createUIManager : Void
- Creates UIManager and sets any properties that need setting
- createLivePreviewMovieClip : Void
- Creates live preview placeholder
- doContentPathConnect : Void
- Called on onEnterFrame to initiate loading the new
- showFirstStream : Void
- _scrubStart : Void
- Called by UIManager when seekbar scrubbing starts
- _scrubFinish : Void
- Called by UIManager when seekbar scrubbing finishes
- skinError (message:String) : Void
- Called by UIManager when skin errors
- skinLoaded : Void
- Called by UIManager when skin loads
Constructor
FLVPlayback
Class properties
ACTIONSCRIPT
ALL
BUFFERING
State constant. State entered immediately afterplay() or load() is called.
This is a responsive state.
CONNECTION_ERROR
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.
DISCONNECTED
State constant. This is the state when the VideoPlayer is
constructed and when the stream is closed by a call toclose() or timed out on idle.
This is a responsive state.
EVENT
FLV
LOADING
State constant. State entered immediately afterplay() or load() is called or
after contentPath property is set.
This is a unresponsive state.
NAVIGATION
PAUSED
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.
PLAYING
State constant. FLV is loaded and is playing.
This state is entered when play()is called.
This is a responsive state.
REWINDING
State constant. State entered during a autorewind triggered
by a stop. After rewind is complete, the state will beSTOPPED.
This is a unresponsive state.
SEEK_TO_PREV_OFFSET_DEFAULT
SEEKING
State constant. State entered after seek()is called and also while user is scrubbing with seek bar.
This is a unresponsive state.
shortVersion
STOPPED
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
VP_DEPTH_OFFSET
Instance properties
__forceNCMgr
__height
__width
_activeVP
_aspectRatio
_autoPlay
_autoRewind
_autoSize
_backButton
_bufferingBar
_bufferingBarHides
_bufferTime
_contentPath
_cpMgr
_cuePoints
_firstStreamReady
_firstStreamShown
_forwardButton
_idleTimeout
_isLive
_muteButton
_origHeight
_origWidth
_pauseButton
_playButton
_playheadUpdateInterval
_playPauseButton
_preSeekTime
_progressInterval
_scaleX
_scaleY
_seekBar
_seekBarInterval
_seekBarScrubTolerance
_seekToPrevOffset
_skin
_skinAutoHide
_stopButton
_topVP
_totalTime
_transform
_uiMgr
_visibleVP
_volume
_volumeBar
_volumeBarInterval
_volumeBarScrubTolerance
_vp
_vpState
activeVideoPlayerIndex
Use activeVideoPlayerIndex to manage multiple FLV streams. Sets
which VideoPlayer instance is affected by most
other APIs. Default is 0. Does not make theVideoPlayer visible, to do this usevisibleVideoPlayerIndex.
A new VideoPlayer is created the first timeactiveVideoPlayerIndex is set to a given number. When
the new VideoPlayer is created, its properties are set to the
value of the default VideoPlayer (
activeVideoPlayerIndex ==
0) except for contentPath, totalTime and isLive, whichare always set to the default values (empty string, 0 and
false, respectively), autoPlay which is always false (default
is true for the default VideoPlayer, aka 0), and height and
width which match those of the visibleVideoPlayerIndex. Note that
the cuePoints property will have no effect, just as it would
have no effect on a subsequent load into the default
VideoPlayer.
APIs that control volume, positioning, dimensions,
visibility and UI controls are always global and their behavior
is NOT affected by setting activeVideoPlayerIndex. The
APIs unaffected are: backButton, bufferingBar,
bufferingBarHidesAndDisablesOthers, forwardButton, height,
muteButton, pauseButton, playButton, playPauseButton, scaleX,
scaleY, seekBar, seekBarInterval, seekBarScrubTolerance,
seekToPrevOffset, skin, transform, stopButton, visible, volume,
volumeBar, volumeBarInterval, volumeBarScrubTolerance, width,
x, y, setSize(), setScale()
APIs that control dimensions do interact withvisibleVideoPlayerIndex, however. See that property
for more on that.
APIs that target specific VideoPlayer depending on setting
of activeVideoPlayerIndex: all the rest!
When listening for events, you will get all events for all
VideoPlayers. To distinguish which VideoPlayer the vent is for
use the events vp property, a Number corresponding
to the number set in activeVideoPlayerIndex and
visibleVideoPlayerIndex. All events have this property EXCEPT for
"resize" and "volumeUpdate" which are not specific to a VideoPlayer
but are global for the FLVPlayback instance.
For example, to load a second FLV in the background, setactiveVideoPlayerIndex to 1 and call load().
When you are ready to show this one and hide the other one, set
visibleVideoPlayerIndex to 1.
| Bindable |
|---|
addEventListener
autoPlay
Determines whether the FLV is played immediately when
contentPath property is set or if we wait. Even if
autoPlay is false, we do load the content immediately.
If set between loads of new FLVs, has no effect until
next set of contentPath.
| Inspectable | defaultValue: true |
|---|
autoRewind
Determines whether the FLV is rewound to the first frame
when play stops, either by calling stop() or by
reaching the end of the stream. Meaningless for live streams.
| Inspectable | defaultValue: true |
|---|
autoSize
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.
| Inspectable | defaultValue: false |
|---|
backButton
back button control. Clicking calls
seekToPrevNavCuePoint().
bitrate
Get the bandwidth. Numerical Value in bits per second.
When streaming from FCS, can provide SMIL file that
describes how to switch between multiple streams based on
bandwidth. Bandwidth is automatically detected by FCS server
and if this value is set, it will be ignored.
When doing http progressive download, can use the same SMIL
format, but must set the bitrate as there is no automatic
detection.
boundingBox_mc
buffering
bufferingBar
buffering bar control. Displays when in loading or
buffering type state.
bufferingBarHidesAndDisablesOthers
If true, we hide and disable certain controls when the
buffering bar is displayed. The seek bar will be hidden, the
play, pause, play/pause, forward and back buttons would be
disabled. Default is false. This only has effect if there
is a buffering bar control.
bufferTime
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
| Inspectable | defaultValue: 0.1 |
|---|
bytesLoaded
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.
| Bindable | |
|---|---|
| ChangeEvent | "progress" |
bytesTotal
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.
| Bindable | |
|---|---|
| ChangeEvent | "progress" |
contentPath
URL that determines FLV to stream and how to stream it.
URL can be http URL to an FLV, rtmp URL to a stream or
http URL to an XML file.
If set via component inspector or property inspector, the
loading and/or playing of FLV starts on next "enterFrame" event.
Delay is to allow time to set isLive, autoPlay and cuePoints
properties, among others, which effect loading, as well as to
allow ActionScript on frame one to effect the FLVPlayback
component before it starts playing.
If set via ActionScript, it immediately callsVideoPlayer.load() if autoPlay is
false or VideoPlayer.play() ifautoPlay is true. Also sends propertiestotalTime and isLive into thoseVideoPlayer APIs, so be sure to set those BEFORE
setting this property.
| Bindable | |
|---|---|
| Inspectable | type: "Video Content Path" |
cuePoints
Write only Array that describes ActionScript cue points and
disabled embedded FLV cue points. This API is created
specifically to be used by the component inspector and
will not work if set in any other way. Its value only
has an effect on the first FLV loaded, and only if it
is loaded by setting the contentPath property in the
component inspector or property inspector.
To add, remove, enable or disable cue points with
ActionScript, use use addASCuePoint(),removeASCuePoint(),setFLVCuePointEnabled().
| Inspectable | type: "Video Cue Points" |
|---|
dispatchEvent
dispatchQueue
forwardButton
height
Height of video
| Bindable | |
|---|---|
| ChangeEvent | "resize" |
idleTimeout
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
Whether stream is live. This property only matters when
streaming from FVSS or FCS; value is ignored when doing
http download.
If set between loads of new FLVs, has no effect until
next set of contentPath.
| Inspectable | defaultValue: false |
|---|
isRTMP
Communication Server), read only.
maintainAspectRatio
Determines whether video aspect ratio is maintained. If
this is set from false to true and autoSize is
false after an FLV has been loaded, an automatic resize will
start immediately.
| Inspectable | defaultValue: true |
|---|
metadata
Read only. Metadata info packet received in onMetaData
callback, if available. Ready when "metadataReceived" event
dispatched.
metadataLoaded
Read only. True if metadata packet has been encountered and
processed OR if it is clear that it will not be. Use this to
check if useful information can be retreived from there various
cue point APIs (findCuePoint, findNearestCuePoint,
findNextCuePointWithName, isFLVCuePointEnabled) for FLV
embedded cue points.
muteButton
mute button control.
ncMgr
Access to instance of the class implementingINCManager. Read only.
One use case for this is that a customINCManager implementation may require custom
initialization.
pauseButton
pause button control.
paused
| Bindable | |
|---|---|
| ChangeEvent | "paused" "stateChange" |
playButton
play button control.
playheadPercentage
Gets the percentage played.
Returns a number between 0 and 100.
Seeks to a percentage of the way through the file.
Takes a number between 0 and 100.
- VideoError if percent is invalid or if totalTime is
undefined, null or <= 0
playheadTime
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.
- The playhead position, measured in seconds since the start. Will return a fractional value.
| Bindable | |
|---|---|
| ChangeEvent | "playheadUpdate" |
playheadUpdateInterval
Property playheadUpdateInterval, which is amount of time
in milliseconds between each "playheadUpdate" event.
If set when stream is playing, will restart timer.
playing
| Bindable | |
|---|---|
| ChangeEvent | "playing" "stateChange" |
playPauseButton
play/pause button control
preferredHeight
property preferredHeight, get only. Gives the height of the
source FLV. This information is not valid immediately upon
calling play() or load(). It is
ready when the "ready" event fires.
- The preferred height of the display.
This is the height of the source FLV.
| Bindable | |
|---|---|
| ChangeEvent | "metadataReceived" |
preferredWidth
property preferredWidth, get only. Gives the width of the
source FLV. This information is not valid immediately upon
calling play() or load(). It is
ready when the "ready" event fires.
- The preferred width of the display.
This is the width of the source FLV.
| Bindable | |
|---|---|
| ChangeEvent | "metadataReceived" |
preview_mc
progressInterval
Property progressInterval, which is amount of time
in milliseconds between each "progress" event.
If set when stream is playing, will restart timer.
removeEventListener
scaleX
| Bindable | |
|---|---|
| ChangeEvent | "resize" |
scaleY
| Bindable | |
|---|---|
| ChangeEvent | "resize" |
scrubbing
True if user is currently scrubbing with the seek bar. read only
seekBar
seek bar control
seekBarInterval
scubbing, in milliseconds. Default is 250.
seekBarScrubTolerance
Determines how far user can move scrub bar before an update
will occur. Specified in percentage from 1 to 100. Set to 0
to indicate no scrub tolerance--always update position on
seekBarInterval regardless of how far user has moved handle.
Default is 5.
seekToPrevOffset
when seekToPrevNavCuePoint compares its time against the
previous cue point, it uses this delta to be sure that if you
are just ahead of a cue point, you can hop over it to the
previous and not get stuck going to the same one over and over
if you are playing. In seconds
skin
Skin swf
| Inspectable | type: "Video Skin" |
|---|
skinAutoHide
Whether to hide the skin when the mouse is not over the video.
Defaults to false.
| Inspectable | defaultValue: false |
|---|
state
Get state. Read only. Set with load(),play(), stop(),pause() and seek().
Descriptive constants for values are defined.
| Bindable | |
|---|---|
| ChangeEvent | "stateChange" |
stateResponsive
Read only. Gets whether state is responsive,
i.e. whether controls should be enabled in the current
state.
stopButton
stop button control.
stopped
| Bindable | |
|---|---|
| ChangeEvent | "stateChange" "stopped" |
totalTime
property totalTime.
When streaming from FCS and using the defaultNCManager, this will be determined
automatically using server side APIs and that value will
override anything set through this property or gathered
from metadata. The property is ready for read when the
STOPPED or PLAYING state is reached after setting thecontentPath property. When live streaming
from FCS, this property is meaningless.
With HTTP download, this property will be determined
automatically if the FLV has metadata embedded, otherwise
it must be set explicitly or it will be 0. If it is set
explicitly than the metadata value in the stream will be
ignored.
When this is set, the setting takes effect for the next
FLV loaded by setting contentPath, it will have no effect
on a flv that has already been loaded. Also, reading this
property will not return the new value passed in until an
flv is loaded.
Playback will still work if this is never set (either
explicitly or automatically), but it may cause problems
with seek controls.
- The total running time of the FLV in seconds
| Bindable | |
|---|---|
| ChangeEvent | "metadataReceived" |
| Inspectable | defaultValue: 0 |
transform
Provides direct access to theSound.setTransform() andSound.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.
version_1_0_2
| Inspectable | defaultValue: "" |
|---|
visible
visibleVideoPlayerIndex
Use visibleVideoPlayerIndex to manage multiple FLV streams.
qSets which VideoPlayer instance is visible and
audible--only one at a time can be, the rest are hidden and
muted. Default is 0. Does not make the VideoPlayertargeted by most APIs, for that useactiveVideoPlayerIndex
APIs that control dimensions interact with this property.
All that set the dimensions (setScale, setSize, set width, set
height, set scaleX, set scaleY) effect all VideoPlayers.
However, depending on whether autoSize or maintaintAspectRatio
are set on those VideoPlayers, they may have different
dimensions. So APIs that get the dimensions (get width, get
height, get scaleX, get scaleY) get the dimensions of the
visible VideoPlayer only, and while other VideoPlayers may
have the same dimensions, they may not.
To get the dimensions of various VideoPlayers when they are
not visible, listen for the "resize" event and cache the size
value yourself.
Does not have any implications for visibility of the
component as a whole, just which VideoPlayer is visible when
the component is visible. To set visibility for the entire
component, use visible property.
volume
Volume control in range from 0 to 100.
- The most recent volume setting
| Bindable | |
|---|---|
| ChangeEvent | "volumeUpdate" |
| Inspectable | defaultValue: 100 |
volumeBar
volume control
volumeBarInterval
when scubbing, in milliseconds. Default is 250.
volumeBarScrubTolerance
Determines how far user can move scrub bar before an update
will occur. Specified in percentage from 1 to 100. Set to 0
to indicate no scrub tolerance--always update volume on
volumeBarInterval regardless of how far user has moved handle.
Default is 0.
width
Width of video
| Bindable | |
|---|---|
| ChangeEvent | "resize" |
x
| Bindable |
|---|
y
| Bindable |
|---|
Instance methods
_scrubFinish
_scrubStart
addASCuePoint
Add an ActionScript cue point.
Cue point information is wiped out when contentPath property
is set, so to set cue point info for the next FLV to be loaded,
set contentPath first.
It is legal to add multiple AS cue points with the same
name and time. When removeASCuePoint is called with this
name and time, all will be removed.
point. Must have a name:String and time:Number (in seconds)
property. May have a parameters:Object property that holds
name/value pairs. May have type:String set to "actionscript",
if it is missing or set to something else it will be set
automatically. If the Object does not conform to these
conventions, a
VideoError will be thrown.If Number, then time for new cue point to be added
and name parameter must follow.
is a Number.
timeOrCuePoint parameter is a Number.
- The cuePoint Object added. Read only: edits to this
Object will effect "cuePoint" event dispatch.
- VideoError if parameters are invalid
bringVideoPlayerToFront
Useful for custom transitions between VideoPlayers.
closeVideoPlayer
deletes VideoPlayer. If the closed video player is the active
or visible VideoPlayer, then active and/or visible VideoPlayer
will be set to the default player (with index 0). You cannot
close the default player, and trying to will throw an error.
createLivePreviewMovieClip
createUIManager
createVideoPlayer
doContentPathConnect
onEnterFrame to initiate loading the newcontentPath url. We delay to give the user time to set other
vars as well. Only done this way when contentPath set from the
component inspector or property inspector, not when set with AS.
findCuePoint
Find the cue point at the given time and/or with given name.
Which type of cue points searched is determined by optionaltype parameter. Default is to search all cue
points. Note that disabled cue points are also included in the
search, use isFLVCuePointEnabled. How the cue points are
searched depends on the type of the first argument.
search for. Return the first cue point with this name, or null
if no match.
If Number, time of cue point to search for. Only first
three decimal places of time used for search, any more than
that will be rounded. Returns the first cue point with this
time (If there are multiples with same time, which is only
possible with ActionScript cue points, then the one with the
first name alphabetically will be returned.) Returns null if
no match.
If Object, then cuepoint object containing time and/or name
properties for search. If name is undefined or null, then
search behaves same as described above for time only search.
If time is undefined, null or less than 0, then search behaves
same as described above for name only search. If both time
and name are defined and a cue point exists with both that
time and name, then it is returned, otherwise null is returned.
If time is null, undefined or less than 0 and name is null
or undefined, a VideoError is thrown.
possible values are "all", "navigation", "event", "flv",
"actionscript". There are constants defined for each of these.
-
nullif no match was found, otherwise
copy of cuePoint object with additional properties:array- the array of cue points that was
searched. Treat this array as read only as adding, removing or
editing objects within it can cause cue points to
malfunction.index- the index into the array for the
returned cuepoint.
findNearestCuePoint
Find the cue point at or near the given time and/or with
given name. Which type of cue points searched is determined by
optional type parameter. Default is to search all
cue points. Note that disabled cue points are also included in
the search, use isFLVCuePointEnabled. How the cue points are
searched depends on the type of the first argument.
search for. Return the first cue point with this name, or null
if no match.
If Number, time of cue point to search for. Only first
three decimal places of time used for search, any more than
that will be rounded. If there is an exact time match, returns
the first cue point with this time (If there are multiples with
same time, which is only possible with ActionScript cue points,
then the one with the first name alphabetically will be
returned.) If the specific time is not found then the closest
time earlier than that is returned. If there is no cue point
earlier than time, the first cue point is returned. If there
are no cue points, null is returned.
If Object, then cuepoint object containing time and/or name
properties for search. If name is undefined or null, then
search behaves same as described above for time only search.
If time is undefined, null or less than 0, then search behaves
same as described above for name only search. If both time
and name are defined and a cue point exists with both that
time and name, then it is returned. If there is no exact
match, then the cue point with that exact name and with the
closest time earlier than that is returned. If there is
no cue point with that name earlier than that time, then
the first cue point with that name is returned. If there
are no cue points with that name, null is returned.
If time is null, undefined or less than 0 and name is null
or undefined, a VideoError is thrown.
possible values are "all", "navigation", "event", "flv",
"actionscript". There are constants defined for each of these.
-
nullif no match was found, otherwise
copy of cuePoint object with additional properties:array- the array of cue points that was
searched. Treat this array as read only as adding, removing or
editing objects within it can cause cue points to
malfunction.index- the index into the array for the
returned cuepoint.