Pacote | org.osmf.metadata |
Classe | public class TimelineMetadata |
Herança | TimelineMetadata ![]() ![]() ![]() |
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | OSMF 1.0 |
Versões de runtime: | Flash Player 10, AIR 1.5 |
TimelineMetadata uses the TimelineMarker class to represent both keys and values (i.e. a TimelineMarker will be stored as both key and value). A TimelineMetadata object dispatches a TimelineMetadataEvent when the currentTime property of the MediaElement's TimeTrait matches any of the time values in its collection of TimelineMarker objects.
Propriedade | Definido por | ||
---|---|---|---|
![]() | constructor : Object
Uma referência ao objeto de classe ou à função de construtor de uma determinada ocorrência de objeto. | Object | |
numMarkers : int [somente leitura]
The number of TimelineMarker objects contained within this object. | TimelineMetadata |
Método | Definido por | ||
---|---|---|---|
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra um objeto de ouvinte de evento em um objeto EventDispatcher, de forma que o ouvinte receba a notificação de um evento. | EventDispatcher | |
Adds the specified TimelineMarker to this object. | TimelineMetadata | ||
![]() |
Envia um evento para o fluxo de eventos. | EventDispatcher | |
Returns the TimelineMarker at the specified index. | TimelineMetadata | ||
![]() |
Verifica se o objeto EventDispatcher tem ouvintes registrados para um tipo específico de evento. | EventDispatcher | |
![]() |
Indica se um objeto tem uma propriedade especificada definida. | Object | |
![]() |
Indica se uma ocorrência da classe Object está na cadeia de protótipos do objeto especificado como o parâmetro. | Object | |
![]() |
Indica se a propriedade especificada existe e é enumerável. | Object | |
![]() |
Remove um ouvinte do objeto EventDispatcher. | EventDispatcher | |
Removes the specified TimelineMarker from this object. | TimelineMetadata | ||
![]() |
Define a disponibilidade de uma propriedade dinâmica para operações de repetição. | Object | |
![]() |
Retorna a representação da string deste objeto, formatado segundo as convenções específicas para a localidade. | Object | |
![]() |
Retorna a representação de string do objeto especificado. | Object | |
![]() |
Retorna o valor primitivo do objeto especificado. | Object | |
![]() |
Verifica se um ouvinte de evento está registrado nesse objeto EventDispatcher ou em qualquer um de seus ancestrais para o tipo de evento especificado. | EventDispatcher |
Evento | Resumo | Definido por | ||
---|---|---|---|---|
![]() | [transmissão de evento] Despachado quando o Flash Player ou o aplicativo do AIR ganha o foco do sistema operacional e está se tornando inativo. | EventDispatcher | ||
![]() | [transmissão de evento] Despachado quando o Flash Player ou o aplicativo do AIR perde o foco do sistema operacional e está se tornando inativo. | EventDispatcher |
numMarkers | propriedade |
addMarker | () | método |
public function addMarker(marker:org.osmf.metadata:TimelineMarker):void
Adds the specified TimelineMarker to this object. This class maintains the TimelineMarkers in time order. If another TimelineMarker with the same time value exists within this object, then the existing value will be overwritten.
Parâmetros
marker:org.osmf.metadata:TimelineMarker — The marker to add.
|
Lança
ArgumentError — If marker is null or specifies an invalid time.
|
getMarkerAt | () | método |
public function getMarkerAt(index:int):org.osmf.metadata:TimelineMarker
Returns the TimelineMarker at the specified index. Note that the markers are sorted by time.
Parâmetros
index:int — The index of the marker to return.
|
org.osmf.metadata:TimelineMarker |
removeMarker | () | método |
public function removeMarker(marker:org.osmf.metadata:TimelineMarker):org.osmf.metadata:TimelineMarker
Removes the specified TimelineMarker from this object.
Parâmetros
marker:org.osmf.metadata:TimelineMarker — The marker to remove.
|
org.osmf.metadata:TimelineMarker |
Lança
ArgumentError — If marker is null.
|
package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import org.osmf.elements.VideoElement; import org.osmf.events.MediaElementEvent; import org.osmf.events.TimelineMetadataEvent; import org.osmf.media.MediaPlayerSprite; import org.osmf.media.URLResource; import org.osmf.metadata.CuePoint; import org.osmf.metadata.TimelineMetadata; public class TimelineMetadataExample extends Sprite { public function TimelineMetadataExample() { super(); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite(); var urlResource:URLResource = new URLResource("rtmp://cp67126.edgefcs.net/ondemand/mp4:mediapm/osmf/content/test/cuepoints/spacealonehd_sounas_640_with_nav.f4v"); videoElement= new VideoElement(); videoElement.resource = urlResource; videoElement.addEventListener(MediaElementEvent.METADATA_ADD, onMetadataAdd); addChild(mediaPlayerSprite); mediaPlayerSprite.media = videoElement; } private function onMetadataAdd(event:MediaElementEvent):void { if (event.namespaceURL == CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE) { var timelineMetadata:TimelineMetadata = videoElement.getMetadata(CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE) as TimelineMetadata; timelineMetadata.addEventListener(TimelineMetadataEvent.MARKER_TIME_REACHED, onCuePoint); } } private function onCuePoint(event:TimelineMetadataEvent):void { var cuePoint:CuePoint = event.marker as CuePoint; trace("Cue Point at " + cuePoint.time); } private var videoElement:VideoElement; } }
Wed Jun 13 2018, 11:10 AM Z