Package | com.brightcove.api.events |
Class | public class MediaEvent |
Inheritance | MediaEvent ![]() |
Property | Defined By | ||
---|---|---|---|
code : String [read-only]
Returns the additional string code, if any, sent with the event. | MediaEvent | ||
data : Object [read-only]
Returns the data, if any, sent with the event. | MediaEvent | ||
duration : Number [read-only]
Returns the duration of the media in seconds. | MediaEvent | ||
media : MediaDTO [read-only]
Returns the video associated with the event. | MediaEvent | ||
position : Number [read-only]
Returns the current position of the media played back in seconds. | MediaEvent | ||
rendition : RenditionAssetDTO [read-only]
Returns the rendition associated with the event. | MediaEvent |
Method | Defined By | ||
---|---|---|---|
MediaEvent(type:String, position:Number = 0, duration:Number = 0, media:MediaDTO = null, rendition:RenditionAssetDTO = null, code:String = null, data:Object = null)
Constructor. | MediaEvent | ||
clone():Event [override]
Returns a copy of the event instance. | MediaEvent |
Constant | Defined By | ||
---|---|---|---|
AUTH_NEEDED : String = authNeeded [static] | MediaEvent | ||
BEGIN : String = mediaBegin [static]
The MediaEvent.BEGIN constant defines the value of the
type property of the event object for a
mediaBegin event. | MediaEvent | ||
BUFFER_BEGIN : String = mediaBufferBegin [static]
The MediaEvent.BUFFER_BEGIN constant defines the value of the
type property of the event object for a
mediaBufferBegin event. | MediaEvent | ||
BUFFER_COMPLETE : String = mediaBufferComplete [static]
The MediaEvent.BUFFER_COMPLETE constant defines the value of the
type property of the event object for a
mediaBufferComplete event. | MediaEvent | ||
CHANGE : String = mediaChange [static]
The MediaEvent.CHANGE constant defines the value of the
type property of the event object for a
mediaChange event. | MediaEvent | ||
COMPLETE : String = mediaComplete [static]
The MediaEvent.COMPLETE constant defines the value of the
type property of the event object for a
mediaComplete event. | MediaEvent | ||
EDGE : String = mediaEdge [static]
The MediaEvent.EDGE constant defines the value of the
type property of the event object for a
edge event. | MediaEvent | ||
ERROR : String = mediaError [static]
The MediaEvent.ERROR constant defines the value of the
type property of the event object for a
mediaError event. | MediaEvent | ||
MUTE_CHANGE : String = mediaMuteChange [static]
The MediaEvent.MUTE_CHANGE constant defines the value of the
type property of the event object for a
mediaMuteChange event. | MediaEvent | ||
PLAY : String = mediaPlay [static]
The MediaEvent.PLAY constant defines the value of the
type property of the event object for a
mediaPlay event. | MediaEvent | ||
PROGRESS : String = mediaProgress [static]
The MediaEvent.PROGRESS constant defines the value of the
type property of the event object for a
mediaProgress event. | MediaEvent | ||
RENDITION_CHANGE_COMPLETE : String = mediaRenditionChangeComplete [static]
The MediaEvent.RENDITION_CHANGE_COMPLETE constant defines the value of the
type property of the event object for a
mediaRenditionChangeComplete event. | MediaEvent | ||
RENDITION_CHANGE_REQUEST : String = mediaRenditionChangeRequest [static]
The MediaEvent.RENDITION_CHANGE_REQUEST constant defines the value of the
type property of the event object for a
mediaRenditionChangeRequest event. | MediaEvent | ||
SEEK : String = mediaSeek [static]
The MediaEvent.SEEK constant defines the value of the
type property of the event object for a
seek event. | MediaEvent | ||
SEEK_NOTIFY : String = mediaSeekNotify [static]
The MediaEvent.SEEK_NOTIFY constant defines the value of the
type property of the event object for a
seek event. | MediaEvent | ||
STOP : String = mediaStop [static]
The MediaEvent.STOP constant defines the value of the
type property of the event object for a
mediaStop event. | MediaEvent | ||
VOLUME_CHANGE : String = mediaVolumeChange [static]
The MediaEvent.VOLUME_CHANGE constant defines the value of the
type property of the event object for a
mediaVolumeChange event. | MediaEvent |
code | property |
code:String
[read-only] Returns the additional string code, if any, sent with the event. This is low-level stream error details, the code property returned in NetStatusEvent.info.
public function get code():String
data | property |
data:Object
[read-only] Returns the data, if any, sent with the event. This includes onEdge event data including a timeSpan property for usage with Akamai HD DVR functionality.
public function get data():Object
duration | property |
duration:Number
[read-only] Returns the duration of the media in seconds. Note that for the MediaEvent.CHANGE event, the duration is reported in milliseconds. This is an unfortunate discrepancy, but to support backwards compatibility for custom players that expect this erroneous behavior this will remain the case. To convert this milliseconds value to seconds, simply divide the value by 1000. For all other MediaEvent types the duration is correctly represented in seconds.
public function get duration():Number
media | property |
media:MediaDTO
[read-only] Returns the video associated with the event.
public function get media():MediaDTO
position | property |
position:Number
[read-only] Returns the current position of the media played back in seconds.
public function get position():Number
rendition | property |
rendition:RenditionAssetDTO
[read-only] Returns the rendition associated with the event.
public function get rendition():RenditionAssetDTO
MediaEvent | () | Constructor |
public function MediaEvent(type:String, position:Number = 0, duration:Number = 0, media:MediaDTO = null, rendition:RenditionAssetDTO = null, code:String = null, data:Object = null)
Constructor.
Parameterstype:String — event name.
| |
position:Number (default = 0 ) — position of the media, in seconds.
| |
duration:Number (default = 0 ) — duration of the media, in seconds.
| |
media:MediaDTO (default = null ) — media associated with the event.
| |
rendition:RenditionAssetDTO (default = null ) — additional string code that should travel with the event.
| |
code:String (default = null )
| |
data:Object (default = null )
|
clone | () | method |
override public function clone():Event
Returns a copy of the event instance.
ReturnsEvent — A copy of the event.
|
AUTH_NEEDED | Constant |
public static const AUTH_NEEDED:String = authNeeded
BEGIN | Constant |
public static const BEGIN:String = mediaBegin
The MediaEvent.BEGIN constant defines the value of the
type
property of the event object for a
mediaBegin
event. BEGIN events are dispatched
when media playback first begins. This will only occur on
initial playback, not on replay.
BUFFER_BEGIN | Constant |
public static const BUFFER_BEGIN:String = mediaBufferBegin
The MediaEvent.BUFFER_BEGIN constant defines the value of the
type
property of the event object for a
mediaBufferBegin
event. BUFFER_BEGIN events
are dispatched when a buffering window begins for the
current media, pausing playback.
BUFFER_COMPLETE | Constant |
public static const BUFFER_COMPLETE:String = mediaBufferComplete
The MediaEvent.BUFFER_COMPLETE constant defines the value of the
type
property of the event object for a
mediaBufferComplete
event. BUFFER_COMPLETE is
dispatched when media finishes a buffering window.
CHANGE | Constant |
public static const CHANGE:String = mediaChange
The MediaEvent.CHANGE constant defines the value of the
type
property of the event object for a
mediaChange
event. CHANGE is dispatched when
new media has been loaded or cued in the player.
COMPLETE | Constant |
public static const COMPLETE:String = mediaComplete
The MediaEvent.COMPLETE constant defines the value of the
type
property of the event object for a
mediaComplete
event. COMPLETE events are
dispatched when the current media finishes. This only
occurs on initial playback of media, not on replay.
EDGE | Constant |
public static const EDGE:String = mediaEdge
The MediaEvent.EDGE constant defines the value of the
type
property of the event object for a
edge
event. EDGE events are dispatched when
there is an onEdge event dispatched by the NetStream
object.
ERROR | Constant |
public static const ERROR:String = mediaError
The MediaEvent.ERROR constant defines the value of the
type
property of the event object for a
mediaError
event. ERROR is dispatched when
there is a problem connecting to or playing the current
media.
MUTE_CHANGE | Constant |
public static const MUTE_CHANGE:String = mediaMuteChange
The MediaEvent.MUTE_CHANGE constant defines the value of the
type
property of the event object for a
mediaMuteChange
event. MUTE_CHANGE is
dispatched when media's audio is muted or unmuted.
PLAY | Constant |
public static const PLAY:String = mediaPlay
The MediaEvent.PLAY constant defines the value of the
type
property of the event object for a
mediaPlay
event. PLAY is dispatched when
media begins or resumes playback.
PROGRESS | Constant |
public static const PROGRESS:String = mediaProgress
The MediaEvent.PROGRESS constant defines the value of the
type
property of the event object for a
mediaProgress
event. PROGRESS is dispatched
periodically while media is being played back.
RENDITION_CHANGE_COMPLETE | Constant |
public static const RENDITION_CHANGE_COMPLETE:String = mediaRenditionChangeComplete
The MediaEvent.RENDITION_CHANGE_COMPLETE constant defines the value of the
type
property of the event object for a
mediaRenditionChangeComplete
event.
RENDITION_CHANGE_COMPLETE is dispatched when the
transition to a new rendition is completed.
RENDITION_CHANGE_REQUEST | Constant |
public static const RENDITION_CHANGE_REQUEST:String = mediaRenditionChangeRequest
The MediaEvent.RENDITION_CHANGE_REQUEST constant defines the value of the
type
property of the event object for a
mediaRenditionChangeRequest
event.
RENDITION_CHANGE_REQUEST is dispatched when a new
rendition of the current media is requested.
SEEK | Constant |
public static const SEEK:String = mediaSeek
The MediaEvent.SEEK constant defines the value of the
type
property of the event object for a
seek
event. SEEK is dispatched when media is
requested to be sent to a new position.
SEEK_NOTIFY | Constant |
public static const SEEK_NOTIFY:String = mediaSeekNotify
The MediaEvent.SEEK_NOTIFY constant defines the value of the
type
property of the event object for a
seek
event. SEEK_NOTIFY events are dispatched
when media has completed being sent to a new position.
STOP | Constant |
public static const STOP:String = mediaStop
The MediaEvent.STOP constant defines the value of the
type
property of the event object for a
mediaStop
event. STOP events are dispatched
when media is paused or stopped.
VOLUME_CHANGE | Constant |
public static const VOLUME_CHANGE:String = mediaVolumeChange
The MediaEvent.VOLUME_CHANGE constant defines the value of the
type
property of the event object for a
mediaVolumeChange
event. VOLUME_CHANGE is
dispatched when the volume in the player is changed.