NetConnection
is closed,
* whether by being timed out, by calling the close()
method,
* or by loading a new video stream. This event is only dispatched
* with RTMP streams, never HTTP.
*
* @eventType spark.events.VideoEvent.CLOSE
*/
Event(name="close", type="spark.events.VideoEvent")
/**
* Dispatched when playing completes because the player reached the end of the FLV file.
* The component does not dispatch the event if you call the stop()
or
* pause()
methods
* or click the corresponding controls.
*
* @eventType spark.events.VideoEvent.COMPLETE
*/
Event(name="complete", type="spark.events.VideoEvent")
/**
* Dispatched the first time the FLV file's metadata is reached.
* The event object has an info
property that contains the
* info object received by the NetStream.onMetaData
event callback.
*
* @eventType spark.events.VideoEvent.METADATA_RECEIVED
*/
Event(name="metadataReceived", type="spark.events.VideoEvent")
/**
* Dispatched every 0.25 seconds while the
* video is playing. This event is not dispatched when it is paused
* or stopped, unless a seek occurs.
*
* @eventType spark.events.VideoEvent.PLAYHEAD_UPDATE
*/
Event(name="playheadUpdate", type="spark.events.VideoEvent")
/**
* Indicates progress made in number of bytes downloaded. Dispatched starting
* when the load begins and ending when all bytes are loaded or there is a network error.
* Dispatched every 0.25 seconds starting when load is called and ending
* when all bytes are loaded or if there is a network error. Use this event to check
* bytes loaded or number of bytes in the buffer.
*
* Dispatched only for a progressive HTTP download. Indicates progress in number of
* downloaded bytes. The event object has the bytesLoaded
and bytesTotal
* properties
This event is dispatched the first time the VideoPlayer
* enters a responsive state after a new FLV is loaded
* with the play()
or load()
method.
* It is dispatched once for each FLV loaded.
source
property is set.
* If true
, the video file immediately begins to buffer and
* play.
*
* Even if autoPlay
is set to false
, Flex
* starts loading the video after the initialize()
method is
* called.
* For Flash Media Server, this means creating the stream and loading
* the first frame to display.
* In the case of an HTTP download, Flex starts downloading the stream
* and shows the first frame.
stop()
method or by
* reaching the end of the stream.
*
* This property has no effect for live streaming video.
*
* @default true
*/
public function get autoRewind():Boolean;
public function set autoRewind(value:Boolean):void;
//----------------------------------
// maintainAspectRatio
//----------------------------------
Inspectable(Category="General", defaultValue="true")
/**
* Specifies whether the control should maintain the original aspect ratio
* while resizing the video.
*
* @default true
*/
public function get maintainAspectRatio():Boolean;
public function set maintainAspectRatio(value:Boolean):void;
//----------------------------------
// muted
//----------------------------------
Inspectable(category="General", defaultValue="false")
/**
* Set to true
to mute the video, false
* to unmute the video.
*/
public function get muted():Boolean;
public function get muted():Boolean;
//----------------------------------
// playheadTime
//----------------------------------
Bindable("playheadUpdate")
Inspectable(Category="General", defaultValue="0")
/**
* Playhead position, measured in seconds, since the video starting
* playing.
* The event object for many of the VideoPlay events include the playhead
* position so that you can determine the location in the video file where
* the event occurred.
*
* Setting this property to a value in seconds performs a seek * operation. * If the video is currently playing, * it continues playing from the new playhead position. * If the video is paused, it seeks to * the new playhead position and remains paused. * If the video is stopped, it seeks to * the new playhead position and enters the paused state. * Setting this property has no effect with live video streams.
* *If the new playhead position is less than 0 or NaN, * the control throws an exception. If the new playhead position * is past the end of the video, or past the amount of the video file * downloaded so far, then the control still attempts the seek.
* *For an FLV file, setting the playheadTime
property seeks
* to the keyframe closest to the specified position, where
* keyframes are specified in the FLV file at the time of encoding.
* Therefore, you might not seek to the exact time if there
* is no keyframe specified at that position.
This property throws an exception if set when no stream is
* connected. Use the stateChange
event and the
* connected
property to determine when it is
* safe to set this property.
The video may not be currently playing, as it may be seeking * or buferring, but the video is attempting to play.
*
* @see #play()
* @see #pause()
* @see #stop()
* @see #autoPlay
*/
public function get playing():Boolean;
//----------------------------------
// source
//----------------------------------
Bindable("sourceChanged")
Inspectable(category="General", defaultValue="null")
/**
* For progressive download, the source is just a path or URL pointing
* to the video file to play. For streaming (streaming, live streaming,
* or multi-bitrate streaming), the source property is a
* StreamingVideoSource object.
*/
public function get source():Object;
public function set source(value:Object):void;
//----------------------------------
// totalTime
//----------------------------------
Bindable("complete")
Bindable("metadataReceived")
Inspectable(defaultValue="NaN")
/**
* Total time for the video feed. -1 means that property
* was not pass into play()
or
* we were unable to detect the total time automatically,
* or have not yet.
*
* @return The total running time of the FLV in seconds
*/
public function get totalTime():Number;
//----------------------------------
// videoObject
//----------------------------------
/**
* The underlying flash player flash.media.Video object
*/
public function get videoObject():Video;
//----------------------------------
// volume
//----------------------------------
Bindable("volumeChanged")
Inspectable(category="General", defaultValue="0.75")
/**
* The volume level, specified as an value between 0 and 1.
*
* @default 0.75
*/
public function get volume():Number;
public function set volume(value:Number):void;
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
/**
* Pauses playback without moving the playhead.
* If playback is already is paused or is stopped, this method has no
* effect.
*
*
To start playback again, call the play()
method.
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.
* * @param time seconds */ public function seek(time:Number):void; /** * Stops video playback. IfautoRewind
is set to
* true
, rewinds to first frame. If video is already
* stopped, has no effect. To start playback again, call
* play()
.
*
* @see #autoRewind
* @see #play()
*/
public function stop():void;
}
}
\\
\\
package spark.components
{
//--------------------------------------
// Events
//--------------------------------------
/**
* Dispatched when the NetConnection
is closed,
* whether by being timed out, by calling the close()
method,
* or by loading a new video stream. This event is only dispatched
* with RTMP streams, never HTTP.
*
* @eventType spark.events.VideoEvent.CLOSE
*/
Event(name="close", type="spark.events.VideoEvent")
/**
* Dispatched when playing completes because the player reached the end of the FLV file.
* The component does not dispatch the event if you call the stop()
or
* pause()
methods
* or click the corresponding controls.
*
* @eventType spark.events.VideoEvent.COMPLETE
*/
Event(name="complete", type="spark.events.VideoEvent")
/**
* Dispatched the first time the FLV file's metadata is reached.
* The event object has an info
property that contains the
* info object received by the NetStream.onMetaData
event callback.
*
* @eventType spark.events.VideoEvent.METADATA_RECEIVED
*/
Event(name="metadataReceived", type="spark.events.VideoEvent")
/**
* Dispatched every 0.25 second while the
* video is playing. This event is not dispatched when it is paused
* or stopped, unless a seek occurs.
*
* @eventType spark.events.VideoEvent.PLAYHEAD_UPDATE
*/
Event(name="playheadUpdate", type="spark.events.VideoEvent")
/**
* Indicates progress made in number of bytes downloaded. Dispatched starting
* when the load begins and ending when all bytes are loaded or there is a network error.
* Dispatched every 0.25 seconds starting when load is called and ending
* when all bytes are loaded or if there is a network error. Use this event to check
* bytes loaded or number of bytes in the buffer.
*
* Dispatched only for a progressive HTTP download. Indicates progress in number of
* downloaded bytes. The event object has the bytesLoaded
and bytesTotal
* properties
This event is dispatched the first time the VideoPlayer
* enters a responsive state after a new FLV is loaded
* with the play()
or load()
method.
* It is dispatched once for each FLV loaded.
true
. When the video is paused or stopped,
* the selected property will be set tofalse.
*/
public var playPauseButton:ToggleButtonBase;
SkinPart(required="false")
/**
* An optional skin part for the scrub bar (the
* timeline).
*/
public var scrubBar:VideoPlayerScrubBar;
SkinPart(required="false")
/**
* An optional skin part for the stop button
*/
public var stopButton:ButtonBase;
SkinPart(required="false")
/**
* An optional skin part to display the totalTime.
*/
public var totalTimeLabel:TextGraphicElement;
SkinPart(required="false")
/**
* An optional skin part for the volume control.
*/
public var volumeBar:VideoPlayerVolumeBar;
//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
//----------------------------------
// autoPlay
//----------------------------------
Inspectable(category="General", defaultValue="true")
/**
* @copy spark.primitives.VideoElement#autoPlay
*/
public function get autoPlay():Boolean;
public function set autoPlay(value:Boolean):void;
//----------------------------------
// autoRewind
//----------------------------------
Inspectable(category="General", defaultValue="true")
/**
* @copy spark.primitives.VideoElement#autoRewind
*/
public function get autoRewind():Boolean;
public function set autoRewind(value:Boolean):void;
//----------------------------------
// maintainAspectRatio
//----------------------------------
Inspectable(Category="General", defaultValue="true")
/**
* @copy spark.primitives.VideoElement#maintainAspectRatio
*/
public function get maintainAspectRatio():Boolean;
public function set maintainAspectRatio(value:Boolean):void;
//----------------------------------
// muted
//----------------------------------
Inspectable(category="General", defaultValue="false")
/**
* @copy spark.primitives.VideoElement#muted
*/
public function get muted():Boolean;
public function set muted(value:Boolean):void;
//----------------------------------
// playheadTime
//----------------------------------
Bindable("playheadUpdate")
Inspectable(Category="General", defaultValue="0")
/**
* @copy spark.primitives.VideoElement#playheadTime
*/
public function get playheadTime():Number;
//----------------------------------
// playing
//----------------------------------
Inspectable(category="General")
/**
* @copy spark.primitives.VideoElement#playing
*/
public function get playing():Boolean;
//----------------------------------
// source
//----------------------------------
Bindable("sourceChanged")
Inspectable(category="General", defaultValue="null")
/**
* @copy spark.primitives.VideoElement#source
*/
public function get source():Object;
public function set source(value:Object):void;
//----------------------------------
// totalTime
//----------------------------------
Bindable("complete")
Bindable("metadataReceived")
Inspectable(defaultValue="NaN")
/**
* @copy spark.primitives.VideoElement#totalTime
*/
public function get totalTime():Number;
//----------------------------------
// volume
//----------------------------------
Bindable("volumeChanged")
Inspectable(category="General", defaultValue="0.75")
/**
* @copy spark.primitives.VideoElement#volume
*/
public function get volume():Number;
public function set volume(value:Number):void;
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
/**
* @copy spark.primitives.VideoElement#pause()
*
* @throws TypeError if the skin hasn't been loaded up yet
* and there's no videoElement
*/
public function pause():void;
/**
* @copy spark.primitives.VideoElement#play()
*
* @throws TypeError if the skin hasn't been loaded up yet
* and there's no videoElement
*/
public function play(startTime:Number=NaN, duration:Number=NaN):void;
/**
* @copy spark.primitives.VideoElement#seek()
*
* @throws TypeError if the skin hasn't been loaded up yet
* and there's no videoElement
*/
public function seek(time:Number):void;
/**
* @copy spark.primitives.VideoElement#stop()
*
* @throws TypeError if the skin hasn't been loaded up yet
* and there's no videoElement
*/
public function stop():void;
}
}
\\
\\
package spark.components.supportClasses
{
DefaultProperty("streamItems")
/**
* The StreamingVideoSource class represents a streaming video source and can be
* used for streaming pre-recorded video or live streaming video. In addition,
* it can support a single stream or multiple streams associated with different
* bitrates. The VideoPlayer
and VideoElement
* classes can take a StreamingVideoSource instance as its source
* property.
*
* @see spark.controls.VideoPlayer
* @see spark.primitives.VideoElement
*/
public class StreamingVideoSource extends Object
{
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
public function StreamingVideoSource();
//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
//----------------------------------
// live
//----------------------------------
Inspectable(category="General", defaultValue="false")
/**
* A Boolean value that is true
if the video stream is live.
*
* Set the live
property to false
when sending
* a prerecorded video stream to the video player and to true
* when sending real-time data such as a live broadcast.
This is how long to wait while hovered over the button before the * pop up opens.
* * @default 200 */ private static const ROLL_OVER_OPEN_DELAY:Number = 200; //-------------------------------------------------------------------------- // // Skin Parts // //-------------------------------------------------------------------------- /** * A skin part that defines the mute/unmute button. */ SkinPart(required="false") public var muteButton:VideoPlayerVolumeBarMuteButton; /** * A skin part that defines the dropDown area. When the volume slider * dropdown is open, clicking anywhere outside of the dropDown skin * part will close the video slider dropdown. */ SkinPart(required="false") public var dropDown:DisplayObject; /** * Constructor. */ public function VideoPlayerVolumeBar(); //-------------------------------------------------------------------------- // // Properties // //-------------------------------------------------------------------------- //---------------------------------- // dropDownController //---------------------------------- /** * Instance of the helper class that handles all of the mouse, keyboard * and focus user interactions. */ protected function get dropDownController():DropDownController; protected function set dropDownController(value:DropDownController):void; //-------------------------------------------------------------------------- // // Methods // //-------------------------------------------------------------------------- /** * Opens the dropDown. */ public function openDropDown():void; /** * Closes the dropDown. * * @param commit Flag indicating if the component should commit the selected * data from the dropDown. * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 4 */ public function closeDropDown(commit:Boolean):void; //-------------------------------------------------------------------------- // // Event handling // //-------------------------------------------------------------------------- /** * Event handler for thedropDownController
* DropdownEvent.OPEN
event. Updates the skin's state and
* ensures that the selectedItem is visible.
*/
protected function dropDownController_openHandler(event:DropdownEvent):void;
/**
* Event handler for the dropDownController
* DropdownEvent.CLOSE
event. Updates the skin's state.
*/
protected function dropDownController_closeHandler(event:DropdownEvent):void;
}
}
\\
\\
package spark.components
{
/**
* The VideoPlayerVolumeBarMuteButton is a mute button
* to be used inside the VideoPlayerVolumeBar. The VideoPlayer
* hooks it up so that when the button is clicked it'll
* mute/unmute the volume. This button has a value property
* so that the visuals of the button can change based on the
* volume.
*/
public class VideoPlayerVolumeBarMuteButton extends Button
{
/**
* Constructor.
*/
public function VideoPlayerVolumeBarMuteButton()
//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
// TODO: should be called volume instead of value?
//----------------------------------
// value
//----------------------------------
Bindable(event="valueCommit")
/**
* The volume of the video player.
*/
public function get value():Number;
public function set value(value:Number):void;
}
}
\\
\\
package spark.events
{
/**
* The VideoEvent class represents the event object passed to the event listener for
* events dispatched by the VideoPlayer control, and defines the values of
* the VideoPlayer.state
property.
*
* @see spark.controls.VideoPlayer
*/
public class VideoEvent extends Event
{
//--------------------------------------------------------------------------
//
// Class constants
//
//--------------------------------------------------------------------------
/**
* The VideoEvent.CLOSE
constant defines the value of the
* type
property of the event object for a close
event.
*
* The properties of the event object have the following values:
* * * * * * * * *Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
* event listener that handles the event. For example, if you use
* myButton.addEventListener() to register an event listener,
* myButton is the value of the currentTarget . |
metadataInfo | If the event was triggerred from * new metadata, an object describing the FLV file. |
playheadTime | The location of the playhead * when the event occurs. |
target | The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the currentTarget property to always access the
* Object listening for the event. |
VideoEvent.COMPLETE
constant defines the value of the
* type
property of the event object for a complete
event.
*
* The properties of the event object have the following values:
* * * * * * * * *Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
* event listener that handles the event. For example, if you use
* myButton.addEventListener() to register an event listener,
* myButton is the value of the currentTarget . |
metadataInfo | If the event was triggerred from * new metadata, an object describing the FLV file. |
playheadTime | The location of the playhead * when the event occurs. |
target | The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the currentTarget property to always access the
* Object listening for the event. |
type
property for a metadataReceived
event.
*
* This event has the following properties:
* * * * * * * * *Property | Value |
---|---|
bubbles | false |
cancelable | false ;
* there is no default behavior to cancel. |
currentTarget | The Object that defines the
* event listener that handles the event. For example, if you use
* myButton.addEventListener() to register an event listener,
* myButton is the value of the currentTarget . |
metadataInfo | If the event was triggerred from * new metadata, an object describing the FLV file. |
playheadTime | The location of the playhead * when the event occurs. |
target | The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the currentTarget property to always access the
* Object listening for the event. |
VideoEvent.PLAYHEAD_UPDATE
constant defines the value of the
* type
property of the event object for a playheadUpdate
event.
*
* The properties of the event object have the following values:
* * * * * * * * *Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
* event listener that handles the event. For example, if you use
* myButton.addEventListener() to register an event listener,
* myButton is the value of the currentTarget . |
metadataInfo | If the event was triggerred from * new metadata, an object describing the FLV file. |
playheadTime | The location of the playhead * when the event occurs. |
target | The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the currentTarget property to always access the
* Object listening for the event. |
VideoEvent.READY
constant defines the value of the
* type
property of the event object for a ready
event.
*
* The properties of the event object have the following values:
* * * * * * * * *Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
* event listener that handles the event. For example, if you use
* myButton.addEventListener() to register an event listener,
* myButton is the value of the currentTarget . |
metadataInfo | If the event was triggerred from * new metadata, an object describing the FLV file. |
playheadTime | The location of the playhead * when the event occurs. |
target | The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the currentTarget property to always access the
* Object listening for the event. |