Paket | org.osmf.media |
Sınıf | public class MediaPlayer |
Miras Alma | MediaPlayer TraitEventDispatcher EventDispatcher Object |
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
It is a high level class that shields the developer from the low level details of the media framework. The MediaPlayer class also provides some convenient features such as loop, auto-play and auto-rewind.
The MediaPlayer can play back all media types supported by the Open Source Media Framework, including media compositions.
Özellik | Tanımlayan: | ||
---|---|---|---|
alternativeAudioStreamSwitching : Boolean [salt okunur]
Indicates whether or not an alternative audio stream switch is currently
in progress. | MediaPlayer | ||
audioPan : Number
Pan property of the media. | MediaPlayer | ||
autoDynamicStreamSwitch : Boolean
Indicates whether or not the media will automatically switch between
dynamic streams. | MediaPlayer | ||
autoPlay : Boolean
Indicates whether the MediaPlayer starts playing the media as soon as its
load operation has successfully completed. | MediaPlayer | ||
autoRewind : Boolean
Indicates whether media is returned to the beginning after playback completes. | MediaPlayer | ||
buffering : Boolean [salt okunur]
Indicates whether the media is currently buffering. | MediaPlayer | ||
bufferLength : Number [salt okunur]
Length of the content currently in the media's
buffer, in seconds. | MediaPlayer | ||
bufferTime : Number
Desired length of the media's buffer, in seconds. | MediaPlayer | ||
bytesLoaded : Number [salt okunur]
The number of bytes of the media that have been loaded. | MediaPlayer | ||
bytesLoadedUpdateInterval : Number
Interval between the dispatch of change events for the bytesLoaded property. | MediaPlayer | ||
bytesTotal : Number [salt okunur]
The total number of bytes of the media that will be loaded. | MediaPlayer | ||
canBuffer : Boolean [salt okunur]
Indicates whether the media can buffer. | MediaPlayer | ||
canLoad : Boolean [salt okunur]
Indicates whether the media can be loaded. | MediaPlayer | ||
canPause : Boolean [salt okunur]
Indicates whether the media can be paused. | MediaPlayer | ||
canPlay : Boolean [salt okunur]
Indicates whether the media can be played. | MediaPlayer | ||
canSeek : Boolean [salt okunur]
Indicates whether the media is seekable. | MediaPlayer | ||
constructor : Object
Belirli bir nesne örneği için sınıf nesnesine veya yapıcı işlevine bir başvuru. | Object | ||
currentAlternativeAudioStreamIndex : int [salt okunur]
The index of the alternative audio stream currently in use. | MediaPlayer | ||
currentDynamicStreamIndex : int [salt okunur]
The index of the dynamic stream currently rendering. | MediaPlayer | ||
currentTime : Number [salt okunur]
Current time of the playhead in seconds. | MediaPlayer | ||
currentTimeUpdateInterval : Number
Interval between the dispatch of change events for the current time
in milliseconds. | MediaPlayer | ||
displayObject : DisplayObject [salt okunur]
DisplayObject for the media. | MediaPlayer | ||
drmEndDate : Date [salt okunur]
Returns the end date for the playback window. | MediaPlayer | ||
drmPeriod : Number [salt okunur]
Returns the length of the playback window, in seconds. | MediaPlayer | ||
drmStartDate : Date [salt okunur]
Returns the start date for the playback window. | MediaPlayer | ||
drmState : String [salt okunur]
The current state of the DRM for this media. | MediaPlayer | ||
duration : Number [salt okunur]
Duration of the media's playback, in seconds. | MediaPlayer | ||
dvrTimeOffset : Number [salt okunur]
Indicates the number of seconds to be added to the time-related
properties (currentTime and duration) of the stream in order to
obtain the real values.
(OSMF always exposes a zero-based timeline)
The dvrTimeOffset might have a non-zero value in case of DVR with
a rolling window.
| MediaPlayer | ||
dynamicStreamSwitching : Boolean [salt okunur]
Indicates whether or not a dynamic stream switch is currently in progress. | MediaPlayer | ||
hasAlternativeAudio : Boolean [salt okunur]
Indicates whether the media has alternative audio streams or not. | MediaPlayer | ||
hasAudio : Boolean [salt okunur]
Indicates whether the media has audio. | MediaPlayer | ||
hasDRM : Boolean [salt okunur]
Return if the the media element has the DRMTrait. | MediaPlayer | ||
isDVRRecording : Boolean [salt okunur]
Returns true if the media is DVR-enabled and currently recording, false if
the media is either not DVR-enabled, or is DVR-enabled but not currently
recording. | MediaPlayer | ||
isDynamicStream : Boolean [salt okunur]
Indicates whether the media consists of a dynamic stream. | MediaPlayer | ||
loop : Boolean
Indicates whether the media should play again after playback has completed. | MediaPlayer | ||
maxAllowedDynamicStreamIndex : int
The maximum allowed dynamic stream index. | MediaPlayer | ||
media : MediaElement [geçersiz kıl]
Source MediaElement controlled by this MediaPlayer. | MediaPlayer | ||
mediaHeight : Number [salt okunur]
Intrinsic height of the media, in pixels. | MediaPlayer | ||
mediaWidth : Number [salt okunur]
Intrinsic width of the media, in pixels. | MediaPlayer | ||
muted : Boolean
Indicates whether the media is currently muted. | MediaPlayer | ||
numAlternativeAudioStreams : int [salt okunur]
Returns the total number of alternative audio streams or 0
if there are no alternative audio streams present. | MediaPlayer | ||
numDynamicStreams : int [salt okunur]
The total number of dynamic stream indices. | MediaPlayer | ||
paused : Boolean [salt okunur]
Indicates whether the media is currently paused. | MediaPlayer | ||
playing : Boolean [salt okunur]
Indicates whether the media is currently playing. | MediaPlayer | ||
seeking : Boolean [salt okunur]
Indicates whether the media is currently seeking. | MediaPlayer | ||
state : String [salt okunur]
The current state of the media. | MediaPlayer | ||
temporal : Boolean [salt okunur]
Indicates whether the media is temporal. | MediaPlayer | ||
volume : Number
Volume of the media. | MediaPlayer |
Yöntem | Tanımlayan: | ||
---|---|---|---|
MediaPlayer(media:MediaElement = null)
Constructor. | MediaPlayer | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
EventDispatcher nesnesi olan bir olay dinleyici nesnesini, dinleyicinin bir olayın bildirimini alması için kaydeder. | EventDispatcher | ||
Authenticates the media. | MediaPlayer | ||
Authenticates the media using an object which serves as a token. | MediaPlayer | ||
Indicates whether the media is capable of seeking to the
specified time. | MediaPlayer | ||
Olay akışına bir olay gönderir. | EventDispatcher | ||
Obtains the alternative audio stream corresponding to the specified
(0-based) index. | MediaPlayer | ||
Gets the associated bitrate, in kilobytes for the specified dynamic stream index. | MediaPlayer | ||
EventDispatcher nesnesinin belirli bir olay türü için kayıtlı dinleyicisi olup olmadığını kontrol eder. | EventDispatcher | ||
Bir nesnenin belirli bir özelliğinin tanımlı olup olmadığını gösterir. | Object | ||
Object sınıfının bir örneğinin parametre olarak belirtilen nesnenin prototip zincirinde olup olmadığını gösterir. | Object | ||
Pauses the media, if it is not already paused. | MediaPlayer | ||
Plays the media, if it is not already playing. | MediaPlayer | ||
Belirtilen özelliğin bulunup bulunmadığını ve numaralandırılabilir olup olmadığını gösterir. | Object | ||
EventDispatcher nesnesinden bir dinleyiciyi kaldırır. | EventDispatcher | ||
Instructs the playhead to jump to the specified time. | MediaPlayer | ||
Dinamik bir özelliğin döngü işlemlerinde kullanılabilirliğini ayarlar. | Object | ||
Immediately halts playback and returns the playhead to the beginning
of the media file. | MediaPlayer | ||
Changes the current audio stream to the alternative audio stream specified by a
0-based index value. | MediaPlayer | ||
Switch to a specific dynamic stream index. | MediaPlayer | ||
Bu nesnenin, yerel ayara özel kurallara göre biçimlendirilmiş dize temsilini döndürür. | Object | ||
Belirtilen nesnenin dize olarak temsil edilen halini döndürür. | Object | ||
Belirtilen nesnenin temel değerini döndürür. | Object | ||
Bir olay dinleyicisinin bu EventDispatcher nesnesiyle mi, yoksa onun belirtilen olay türüne yönelik üst öğelerinden biriyle mi kayıtlı olduğunu kontrol eder. | EventDispatcher |
Olay | Özet | Tanımlayan: | ||
---|---|---|---|---|
[broadcast olayı] Flash Player veya AIR uygulaması işletim sistemi odağına gelip etkin olduğunda gönderilir. | EventDispatcher | |||
Dispatched when an alternative audio stream switch is requested, completed, or has failed. | TraitEventDispatcher | |||
Dispatched when the autoSwitch property has changed. | TraitEventDispatcher | |||
Dispatched when the buffering property has changed. | TraitEventDispatcher | |||
Dispatched when the bufferTime property has changed. | TraitEventDispatcher | |||
Dispatched when the value of bytesLoaded has changed. | MediaPlayer | |||
Dispatched when the bytesTotal property has changed. | TraitEventDispatcher | |||
Dispatched when the canBuffer property has changed. | MediaPlayer | |||
Dispatched when the canLoad property has changed. | MediaPlayer | |||
Dispatched when the canPause property has changed. | TraitEventDispatcher | |||
Dispatched when the canPlay property has changed. | MediaPlayer | |||
Dispatched when the canSeek property has changed. | MediaPlayer | |||
Dispatched when the media has completed playback. | TraitEventDispatcher | |||
Dispatched when the currentTime property of the media has changed. | MediaPlayer | |||
[broadcast olayı] Çalışan Flash Player veya AIR uygulaması sistem odağını kaybettiğinde ve etkin olmayan duruma geldiğinde gönderilir. | EventDispatcher | |||
Dispatched when the displayObject property of the media has changed. | TraitEventDispatcher | |||
Dispatched when the state of the DRMTrait has changed. | TraitEventDispatcher | |||
Dispatched when the duration property of the media has changed. | TraitEventDispatcher | |||
Dispatched when the hasAlternativeAudio property has changed. | MediaPlayer | |||
Dispatched when the hasAudio property has changed. | MediaPlayer | |||
Dispatched when the hasDisplayObjectChange property has changed. | MediaPlayer | |||
Dispatched when the hasDRM property has changed. | MediaPlayer | |||
Dispatched when the isDynamicStream property has changed. | MediaPlayer | |||
Dispatched when the isRecording property has changed. | TraitEventDispatcher | |||
Dispatched when playback resumes after a live stall | MediaPlayer | |||
Dispatched when playback runs out of content for a live stream but the stream is not done. | MediaPlayer | |||
Dispatched when the state of the LoadTrait has changed. | TraitEventDispatcher | |||
Dispatched when an error which impacts the operation of the media player occurs. | MediaPlayer | |||
Dispatched when the MediaPlayer's state has changed. | MediaPlayer | |||
Dispatched when the mediaWidth and/or mediaHeight property of the media has changed. | TraitEventDispatcher | |||
Dispatched when the muted property of the media has changed. | TraitEventDispatcher | |||
Dispatched when the number of alternative audio streams has changed. | TraitEventDispatcher | |||
Dispatched when the number of dynamic streams has changed. | TraitEventDispatcher | |||
Dispatched when the pan property of the media has changed. | TraitEventDispatcher | |||
Dispatched when the playing or paused property of the media has changed. | TraitEventDispatcher | |||
Dispatched when the seeking property of the media has changed. | TraitEventDispatcher | |||
Dispatched when a dynamic stream switch change occurs. | TraitEventDispatcher | |||
Dispatched when the temporal property has changed. | MediaPlayer | |||
Dispatched when the volume property of the media has changed. | TraitEventDispatcher |
alternativeAudioStreamSwitching | özellik |
alternativeAudioStreamSwitching:Boolean
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.6 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Indicates whether or not an alternative audio stream switch is currently
in progress.
This property will return true
while an audio stream switch
has been requested and the switch has not yet been acknowledged and no
switch failure has occurred. Once the switch request has been acknowledged
or a failure occurs, the property will return false
.
Uygulama
public function get alternativeAudioStreamSwitching():Boolean
audioPan | özellik |
audioPan:Number
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Pan property of the media. Ranges from -1 (full pan left) to 1 (full pan right).
If the MediaElement doesn't have audio, then the pan property will be set to this value as soon as the MediaElement has audio.
Uygulama
public function get audioPan():Number
public function set audioPan(value:Number):void
autoDynamicStreamSwitch | özellik |
autoDynamicStreamSwitch:Boolean
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Indicates whether or not the media will automatically switch between
dynamic streams. If in manual mode the switchDynamicStreamIndex
method can be used to manually switch to a specific stream.
The default is true.
Uygulama
public function get autoDynamicStreamSwitch():Boolean
public function set autoDynamicStreamSwitch(value:Boolean):void
autoPlay | özellik |
autoPlay:Boolean
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Indicates whether the MediaPlayer starts playing the media as soon as its
load operation has successfully completed.
The default is true
.
Uygulama
public function get autoPlay():Boolean
public function set autoPlay(value:Boolean):void
autoRewind | özellik |
autoRewind:Boolean
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Indicates whether media is returned to the beginning after playback completes.
If true
, when playback completes, the player displays the first
frame of the media. If false
, when playback completes, the last
frame is displayed. The default is true
. The autoRewind
property is ignored if the loop
property is set to true
.
Uygulama
public function get autoRewind():Boolean
public function set autoRewind(value:Boolean):void
buffering | özellik |
bufferLength | özellik |
bufferTime | özellik |
bufferTime:Number
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Desired length of the media's buffer, in seconds.
If the passed value is non numerical or negative, it is forced to zero.
The default is zero.
Uygulama
public function get bufferTime():Number
public function set bufferTime(value:Number):void
bytesLoaded | özellik |
bytesLoadedUpdateInterval | özellik |
bytesLoadedUpdateInterval:Number
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Interval between the dispatch of change events for the bytesLoaded property.
The default is 250 milliseconds. A non-positive value disables the dispatch of the change events.
Uygulama
public function get bytesLoadedUpdateInterval():Number
public function set bytesLoadedUpdateInterval(value:Number):void
İlgili API Öğeleri
bytesTotal | özellik |
canBuffer | özellik |
canLoad | özellik |
canPause | özellik |
canPlay | özellik |
canSeek | özellik |
currentAlternativeAudioStreamIndex | özellik |
currentAlternativeAudioStreamIndex:int
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.6 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
The index of the alternative audio stream currently in use. Returns the
0-based index of the selected stream, or -1
if no stream
is selected.
Uygulama
public function get currentAlternativeAudioStreamIndex():int
currentDynamicStreamIndex | özellik |
currentTime | özellik |
currentTimeUpdateInterval | özellik |
currentTimeUpdateInterval:Number
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Interval between the dispatch of change events for the current time in milliseconds.
The default is 250 milliseconds. A non-positive value disables the dispatch of the change events.
Uygulama
public function get currentTimeUpdateInterval():Number
public function set currentTimeUpdateInterval(value:Number):void
İlgili API Öğeleri
displayObject | özellik |
displayObject:DisplayObject
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
DisplayObject for the media.
Uygulama
public function get displayObject():DisplayObject
drmEndDate | özellik |
drmPeriod | özellik |
drmPeriod:Number
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Returns the length of the playback window, in seconds. Returns NaN if authentication hasn't taken place or if hasDRM is false. Note that this property will generally be the difference between startDate and endDate, but is included as a property because there may be times where the duration is known up front, but the start or end dates are not (e.g. a one week rental).
Uygulama
public function get drmPeriod():Number
drmStartDate | özellik |
drmStartDate:Date
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Returns the start date for the playback window. Returns null if authentication hasn't taken place or if hasDRM is false.
Uygulama
public function get drmStartDate():Date
drmState | özellik |
drmState:String
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
The current state of the DRM for this media. The states are explained in the DRMState enumeration in the org.osmf.drm package. Returns DRMState.UNINITIALIZED if hasDRM is false.
Uygulama
public function get drmState():String
İlgili API Öğeleri
duration | özellik |
dvrTimeOffset | özellik |
dvrTimeOffset:Number
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 2.0.1 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Indicates the number of seconds to be added to the time-related properties (currentTime and duration) of the stream in order to obtain the real values. (OSMF always exposes a zero-based timeline)
The dvrTimeOffset might have a non-zero value in case of DVR with a rolling window.
Uygulama
public function get dvrTimeOffset():Number
dynamicStreamSwitching | özellik |
dynamicStreamSwitching:Boolean
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Indicates whether or not a dynamic stream switch is currently in progress.
This property will return true
while a switch has been
requested and the switch has not yet been acknowledged and no switch failure
has occurred. Once the switch request has been acknowledged or a
failure occurs, the property will return false
.
Uygulama
public function get dynamicStreamSwitching():Boolean
hasAlternativeAudio | özellik |
hasAudio | özellik |
hasDRM | özellik |
isDVRRecording | özellik |
isDVRRecording:Boolean
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Returns true if the media is DVR-enabled and currently recording, false if the media is either not DVR-enabled, or is DVR-enabled but not currently recording.
Uygulama
public function get isDVRRecording():Boolean
isDynamicStream | özellik |
loop | özellik |
loop:Boolean
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Indicates whether the media should play again after playback has completed.
The loop
property takes precedence over the autoRewind
property,
so if loop
is set to true
, the autoRewind
property
is ignored.
The default is false
.
Uygulama
public function get loop():Boolean
public function set loop(value:Boolean):void
maxAllowedDynamicStreamIndex | özellik |
maxAllowedDynamicStreamIndex:int
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
The maximum allowed dynamic stream index. This can be set at run-time to provide a ceiling for the switching profile, for example, to keep from switching up to a higher quality stream when the current video is too small handle a higher quality stream.
Uygulama
public function get maxAllowedDynamicStreamIndex():int
public function set maxAllowedDynamicStreamIndex(value:int):void
Atar
RangeError — If the specified dynamic stream index is less than zero or
greater than the highest dynamic stream index available.
| |
IllegalOperationError — If the media is not a dynamic stream.
|
media | özellik |
media:MediaElement
[geçersiz kıl] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Source MediaElement controlled by this MediaPlayer. Setting the media will attempt to load media that is loadable, that isn't loading or loaded. It will automatically unload media when the property changes to a new MediaElement or null.
Uygulama
override public function get media():MediaElement
override public function set media(value:MediaElement):void
mediaHeight | özellik |
mediaHeight:Number
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Intrinsic height of the media, in pixels. The intrinsic height is the height of the media before any processing has been applied. The default if no DisplayObjectTrait is present, is NaN.
Uygulama
public function get mediaHeight():Number
mediaWidth | özellik |
mediaWidth:Number
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Intrinsic width of the media, in pixels. The intrinsic width is the width of the media before any processing has been applied. The default if no DisplayObjectTrait is present, is NaN.
Uygulama
public function get mediaWidth():Number
muted | özellik |
muted:Boolean
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Indicates whether the media is currently muted.
If the MediaElement doesn't have audio, then the muted state will be set to this value as soon as the MediaElement has audio.
Uygulama
public function get muted():Boolean
public function set muted(value:Boolean):void
numAlternativeAudioStreams | özellik |
numAlternativeAudioStreams:int
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.6 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Returns the total number of alternative audio streams or 0
if there are no alternative audio streams present.
Uygulama
public function get numAlternativeAudioStreams():int
numDynamicStreams | özellik |
paused | özellik |
playing | özellik |
seeking | özellik |
state | özellik |
temporal | özellik |
volume | özellik |
volume:Number
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Volume of the media. Ranges from 0 (silent) to 1 (full volume).
If the MediaElement doesn't have audio, then the volume will be set to this value as soon as the MediaElement has audio.
Uygulama
public function get volume():Number
public function set volume(value:Number):void
MediaPlayer | () | Yapıcı |
public function MediaPlayer(media:MediaElement = null)
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Constructor.
Parametrelermedia:MediaElement (default = null ) — Source MediaElement to be controlled by this MediaPlayer.
|
authenticate | () | yöntem |
public function authenticate(username:String = null, password:String = null):void
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Authenticates the media. Can be used for both anonymous and credential-based authentication. If the media has already been authenticated or authentication is anonymous, this is a no-op.
Parametreler
username:String (default = null ) — The username.
| |
password:String (default = null ) — The password.
|
Atar
IllegalOperationError — If the media is not initialized yet, or hasDRM
is false.
|
authenticateWithToken | () | yöntem |
public function authenticateWithToken(token:Object):void
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Authenticates the media using an object which serves as a token. Can be used for both anonymous and credential-based authentication. If the media has already been authenticated or if the media isn't drm protected, this is a no-op.
Parametreler
token:Object — The token to use for authentication.
|
Atar
IllegalOperationError — If the media is not initialized yet, or hasDRM
is false.
|
canSeekTo | () | yöntem |
public function canSeekTo(time:Number):Boolean
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Indicates whether the media is capable of seeking to the specified time.
Parametreler
time:Number — Time to seek to in seconds.
|
Boolean — Returns true if the media can seek to the specified time.
|
getAlternativeAudioItemAt | () | yöntem |
public function getAlternativeAudioItemAt(index:int):StreamingItem
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.6 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Obtains the alternative audio stream corresponding to the specified
(0-based) index. Returns null
if the index is -1
.
Parametreler
index:int |
StreamingItem |
Atar
RangeError — if the specified alternative audio stream index is less
than -1 or greater than the highest alternative audio
index available.
| |
IllegalOperationError — if the currently loaded media does not have
any associated alternative audio streams.
|
getBitrateForDynamicStreamIndex | () | yöntem |
public function getBitrateForDynamicStreamIndex(index:int):Number
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Gets the associated bitrate, in kilobytes for the specified dynamic stream index.
Parametreler
index:int |
Number |
Atar
RangeError — If the specified dynamic stream index is less than zero or
greater than the highest dynamic stream index available.
| |
IllegalOperationError — If the media is not a dynamic stream.
|
pause | () | yöntem |
public function pause():void
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Pauses the media, if it is not already paused.
Atar
IllegalOperationError — if the media cannot be paused.
|
play | () | yöntem |
public function play():void
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Plays the media, if it is not already playing. To use the play() method, MediaPlayer.canPlay must be true. You must listen for the mediaPlayerStateChange event, and only call play() (or enable the UI play button) when the state is READY.
Atar
IllegalOperationError — if the media cannot be played.
|
seek | () | yöntem |
public function seek(time:Number):void
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Instructs the playhead to jump to the specified time.
If time
is NaN or negative, does not attempt to seek.
Parametreler
time:Number — Time to seek to in seconds.
|
Atar
IllegalOperationError — if the media cannot be seeked.
|
stop | () | yöntem |
public function stop():void
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Immediately halts playback and returns the playhead to the beginning of the media file.
Atar
IllegalOperationError — If the media cannot be played (and therefore
cannot be stopped).
|
switchAlternativeAudioIndex | () | yöntem |
public function switchAlternativeAudioIndex(streamIndex:int):void
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.6 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Changes the current audio stream to the alternative audio stream specified by a
0-based index value. Passing -1
as the index value resets the current
audio stream to the default audio stream.
Note that if media playback is paused, the audio stream switch does not occur
until after play resumes.
Parametreler
streamIndex:int |
Atar
RangeError — if the specified alternative audio stream index is less than
-1 or greater than numAlternativeAudioStreams - 1 .
| |
IllegalOperationError — if the currently loaded media does not have
any associated alternative audio streams.
|
switchDynamicStreamIndex | () | yöntem |
public function switchDynamicStreamIndex(streamIndex:int):void
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Switch to a specific dynamic stream index. To switch up, use the currentDynamicStreamIndex
property, such as:
mediaPlayer.switchDynamicStreamIndex(mediaPlayer.currentDynamicStreamIndex + 1);
Parametreler
streamIndex:int |
Atar
RangeError — If the specified dynamic stream index is less than zero or
greater than maxAllowedDynamicStreamIndex .
| |
IllegalOperationError — If the media is not a dynamic stream, or if the dynamic
stream is not in manual switch mode.
|
İlgili API Öğeleri
bytesLoadedChange | Olay |
org.osmf.events.LoadEvent
özellik LoadEvent.type =
org.osmf.events.LoadEvent
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the value of bytesLoaded has changed.
canBufferChange | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.CAN_BUFFER_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the canBuffer
property has changed.
canLoadChange | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.CAN_LOAD_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the canLoad
property has changed.
canPlayChange | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.CAN_PLAY_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the canPlay
property has changed.
canSeekChange | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.CAN_SEEK_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the canSeek
property has changed.
currentTimeChange | Olay |
org.osmf.events.TimeEvent
özellik TimeEvent.type =
org.osmf.events.TimeEvent.CURRENT_TIME_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the currentTime
property of the media has changed.
This value is updated at the interval set by
the MediaPlayer's currentTimeUpdateInterval
property.
hasAlternativeAudio | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.HAS_ALTERNATIVE_AUDIO_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.6 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the hasAlternativeAudio
property has changed.
hasAlternativeAudio
property has changed.
hasAudioChange | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.HAS_AUDIO_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the hasAudio
property has changed.
hasDisplayObjectChange | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.HAS_DISPLAY_OBJECT_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the hasDisplayObjectChange
property has changed.
hasDRMChange | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.HAS_DRM_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the hasDRM
property has changed.
isDynamicStreamChange | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.IS_DYNAMIC_STREAM_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the isDynamicStream
property has changed.
liveResume | Olay |
org.osmf.events.PlayEvent
özellik PlayEvent.type =
org.osmf.events.PlayEvent.LIVE_RESUME
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 2.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when playback resumes after a live stall
The PlayEvent.LIVE_RESUME constant defines the value of the type property of the event object for a liveResume event.
Dispatched when playback resumes after a live stall
liveStall | Olay |
org.osmf.events.PlayEvent
özellik PlayEvent.type =
org.osmf.events.PlayEvent.LIVE_STALL
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 2.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when playback runs out of content for a live stream but the stream is not done.
The PlayEvent.LIVE_STALL constant defines the value of the type property of the event object for a liveStall event.
Dispatched when playback runs out of content for a live stream but the stream is not done.
mediaError | Olay |
org.osmf.events.MediaErrorEvent
özellik MediaErrorEvent.type =
org.osmf.events.MediaErrorEvent.MEDIA_ERROR
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when an error which impacts the operation of the media player occurs.
The MediaErrorEvent.MEDIA_ERROR constant defines the value of the type property of the event object for a mediaError event.mediaPlayerStateChange | Olay |
org.osmf.events.MediaPlayerStateChangeEvent
özellik MediaPlayerStateChangeEvent.type =
org.osmf.events.MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the MediaPlayer's state has changed.
The MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE constant defines the value of the type property of the event object for a mediaPlayerStateChange event.temporalChange | Olay |
org.osmf.events.MediaPlayerCapabilityChangeEvent
özellik MediaPlayerCapabilityChangeEvent.type =
org.osmf.events.MediaPlayerCapabilityChangeEvent.TEMPORAL_CHANGE
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | OSMF 1.0 |
Çalışma Zamanı Sürümleri: | Flash Player 10, AIR 1.5 |
Dispatched when the temporal
property has changed.
package org.osmf.media { import flash.display.Sprite; import org.osmf.containers.MediaContainer; import org.osmf.elements.AudioElement; import org.osmf.events.TimeEvent; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; public class MediaPlayerExample extends Sprite { private var mediaPlayer:MediaPlayer; public function MediaPlayerExample() { super(); mediaPlayer = new MediaPlayer(); var audioElement:AudioElement = new AudioElement(); audioElement.resource = new URLResource("http://mediapm.edgesuite.net/osmf/content/test/train_1500.mp3"); mediaPlayer.volume = .5; mediaPlayer.loop = true; mediaPlayer.addEventListener(TimeEvent.CURRENT_TIME_CHANGE, onTimeUpdated); mediaPlayer.addEventListener(TimeEvent.DURATION_CHANGE, onTimeUpdated); mediaPlayer.autoPlay = true; mediaPlayer.media = audioElement; } private function onTimeUpdated(event:TimeEvent):void { trace('time: ' + mediaPlayer.currentTime + ' duration: ' + mediaPlayer.duration); } } }
Tue Jun 12 2018, 01:09 PM Z