Brought up to date with the private repository (feea4c7)

This commit is contained in:
S committed 2026-10-14 20:57:33 +03:00
1 parent 1aa738d692
commit 1b1df1ae48
7925 files changed
+2617237 -20

No files matched your search

@@ -0,0 +1,40 @@
package org.osmf.metadata
{
public class CuePoint extends TimelineMarker
{
public static const EMBEDDED_CUEPOINTS_NAMESPACE:String = "http://www.osmf.org/timeline/embeddedCuePoints/1.0";
public static const DYNAMIC_CUEPOINTS_NAMESPACE:String = "http://www.osmf.org/timeline/dynamicCuePoints/1.0";
private var _name:String;
private var _type:String;
private var _parameters:Object;
public function CuePoint(param1:String, param2:Number, param3:String, param4:Object, param5:Number = NaN)
{
super(param2,param5);
this._type = param1;
this._name = param3;
this._parameters = param4;
}
public function get type() : String
{
return this._type;
}
public function get name() : String
{
return this._name;
}
public function get parameters() : Object
{
return this._parameters;
}
}
}
@@ -0,0 +1,83 @@
package org.osmf.metadata
{
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.utils.Dictionary;
import org.osmf.events.MetadataEvent;
import org.osmf.utils.OSMFStrings;
public class Metadata extends EventDispatcher
{
private var data:Dictionary;
public function Metadata()
{
super();
}
public function getValue(param1:String) : *
{
if(param1 == null)
{
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.NULL_PARAM));
}
return this.data != null ? this.data[param1] : null;
}
public function addValue(param1:String, param2:Object) : void
{
var _loc4_:Event = null;
if(param1 == null)
{
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.NULL_PARAM));
}
if(this.data == null)
{
this.data = new Dictionary();
}
var _loc3_:* = this.data[param1];
this.data[param1] = param2;
if(_loc3_ != param2)
{
_loc4_ = _loc3_ === undefined ? new MetadataEvent(MetadataEvent.VALUE_ADD,false,false,param1,param2) : new MetadataEvent(MetadataEvent.VALUE_CHANGE,false,false,param1,param2,_loc3_);
dispatchEvent(_loc4_);
}
}
public function removeValue(param1:String) : *
{
if(param1 == null)
{
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.NULL_PARAM));
}
var _loc2_:* = this.data[param1];
if(_loc2_ !== undefined)
{
delete this.data[param1];
dispatchEvent(new MetadataEvent(MetadataEvent.VALUE_REMOVE,false,false,param1,_loc2_));
}
return _loc2_;
}
public function get keys() : Vector.<String>
{
var _loc2_:Object = null;
var _loc1_:Vector.<String> = new Vector.<String>();
if(this.data != null)
{
for(_loc2_ in this.data)
{
_loc1_.push(_loc2_);
}
}
return _loc1_;
}
public function get synthesizer() : MetadataSynthesizer
{
return null;
}
}
}
@@ -0,0 +1,62 @@
package org.osmf.metadata
{
public final class MetadataNamespaces
{
public static const MEDIA_ELEMENT_METADATA:String = "http://www.osmf.org/mediaElement/1.0";
public static const DERIVED_RESOURCE_METADATA:String = "http://www.osmf.org/derivedResource/1.0";
public static const FMS_SERVER_VERSION_METADATA:String = "http://www.osmf.org/fmsServerVersion/1.0";
public static const ELEMENT_ID:String = "http://www.osmf.org/layout/elementId/1.0";
public static const LAYOUT_RENDERER_TYPE:String = "http://www.osmf.org/layout/renderer_type/1.0";
public static const ABSOLUTE_LAYOUT_PARAMETERS:String = "http://www.osmf.org/layout/absolute/1.0";
public static const RELATIVE_LAYOUT_PARAMETERS:String = "http://www.osmf.org/layout/relative/1.0";
public static const ANCHOR_LAYOUT_PARAMETERS:String = "http://www.osmf.org/layout/anchor/1.0";
public static const PADDING_LAYOUT_PARAMETERS:String = "http://www.osmf.org/layout/padding/1.0";
public static const LAYOUT_ATTRIBUTES:String = "http://www.osmf.org/layout/attributes/1.0";
public static const BOX_LAYOUT_ATTRIBUTES:String = "http://www.osmf.org/layout/attributes/box/1.0";
public static const DRM_METADATA:String = "http://www.osmf.org/drm/1.0";
public static const MULTICAST_INFO:String = "http://www.osmf.org/multicast/info/1.0";
public static const MULTICAST_NET_LOADER:String = "http://www.osmf.org/multicast/netloader/1.0";
public static const DVR_METADATA:String = "http://www.osmf.org/dvr/1.0";
public static const DRM_ADDITIONAL_HEADER_KEY:String = "DRMAdditionalHeader";
public static const HTTP_STREAMING_METADATA:String = "http://www.osmf.org/httpstreaming/1.0";
public static const HTTP_STREAMING_BOOTSTRAP_KEY:String = "bootstrap";
public static const HTTP_STREAMING_STREAM_METADATA_KEY:String = "streamMetadata";
public static const HTTP_STREAMING_XMP_METADATA_KEY:String = "xmpMetadata";
public static const HTTP_STREAMING_SERVER_BASE_URLS_KEY:String = "serverBaseUrls";
public static const HTTP_STREAMING_DVR_BEGIN_OFFSET_KEY:String = "beginOffset";
public static const HTTP_STREAMING_DVR_END_OFFSET_KEY:String = "endOffset";
public static const HTTP_STREAMING_DVR_OFFLINE_KEY:String = "dvrOffline";
public static const HTTP_STREAMING_DVR_ID_KEY:String = "dvrId";
public function MetadataNamespaces()
{
super();
}
}
}
@@ -0,0 +1,28 @@
package org.osmf.metadata
{
import org.osmf.elements.compositeClasses.CompositionMode;
public class MetadataSynthesizer
{
public function MetadataSynthesizer()
{
super();
}
public function synthesize(param1:String, param2:Metadata, param3:Vector.<Metadata>, param4:String, param5:Metadata) : Metadata
{
var _loc6_:Metadata = null;
if(param4 == CompositionMode.SERIAL && Boolean(param5))
{
_loc6_ = param5.getValue(param1) as Metadata;
}
else
{
_loc6_ = param3.length >= 1 ? param3[0] : null;
}
return _loc6_;
}
}
}
@@ -0,0 +1,171 @@
package org.osmf.metadata
{
import flash.errors.IllegalOperationError;
import org.osmf.events.MetadataEvent;
import org.osmf.utils.OSMFStrings;
public class MetadataWatcher
{
private var parentMetadata:Metadata;
private var namespaceURL:String;
private var key:String;
private var callback:Function;
private var currentMetadata:Metadata;
private var watching:Boolean;
public function MetadataWatcher(param1:Metadata, param2:String, param3:String, param4:Function)
{
super();
if(param1 == null || param2 == null || param4 == null)
{
throw new IllegalOperationError(OSMFStrings.getString(OSMFStrings.NULL_PARAM));
}
this.parentMetadata = param1;
this.namespaceURL = param2;
this.key = param3;
this.callback = param4;
}
public function watch(param1:Boolean = true) : void
{
if(this.watching == false)
{
this.watching = true;
this.parentMetadata.addEventListener(MetadataEvent.VALUE_ADD,this.onMetadataAdd,false,0,true);
this.processWatchedMetadataChange(this.parentMetadata.getValue(this.namespaceURL) as Metadata);
if(param1 == true)
{
if(this.key != null)
{
this.callback(this.currentMetadata ? this.currentMetadata.getValue(this.key) : undefined);
}
else
{
this.callback(this.currentMetadata ? this.currentMetadata : undefined);
}
}
}
}
public function unwatch() : void
{
if(this.watching == true)
{
this.processWatchedMetadataChange(null,false);
this.parentMetadata.removeEventListener(MetadataEvent.VALUE_ADD,this.onMetadataAdd);
this.watching = false;
}
}
private function processWatchedMetadataChange(param1:Metadata, param2:Boolean = true) : void
{
var _loc3_:Metadata = null;
if(this.currentMetadata != param1)
{
_loc3_ = this.currentMetadata;
if(this.currentMetadata)
{
this.currentMetadata.removeEventListener(MetadataEvent.VALUE_CHANGE,this.onValueChange);
this.currentMetadata.removeEventListener(MetadataEvent.VALUE_ADD,this.onValueAdd);
this.currentMetadata.removeEventListener(MetadataEvent.VALUE_REMOVE,this.onValueRemove);
this.parentMetadata.removeEventListener(MetadataEvent.VALUE_REMOVE,this.onMetadataRemove);
}
else
{
this.parentMetadata.removeEventListener(MetadataEvent.VALUE_ADD,this.onMetadataAdd);
}
this.currentMetadata = param1;
if(param1)
{
param1.addEventListener(MetadataEvent.VALUE_CHANGE,this.onValueChange,false,0,true);
param1.addEventListener(MetadataEvent.VALUE_ADD,this.onValueAdd,false,0,true);
param1.addEventListener(MetadataEvent.VALUE_REMOVE,this.onValueRemove,false,0,true);
this.parentMetadata.addEventListener(MetadataEvent.VALUE_REMOVE,this.onMetadataRemove);
}
else
{
this.parentMetadata.addEventListener(MetadataEvent.VALUE_ADD,this.onMetadataAdd);
}
}
}
private function onMetadataAdd(param1:MetadataEvent) : void
{
var _loc2_:Metadata = param1.value as Metadata;
if(Boolean(_loc2_) && param1.key == this.namespaceURL)
{
this.processWatchedMetadataChange(_loc2_);
if(this.key == null)
{
this.callback(_loc2_);
}
else
{
this.callback(_loc2_.getValue(this.key));
}
}
}
private function onMetadataRemove(param1:MetadataEvent) : void
{
var _loc2_:Metadata = param1.value as Metadata;
if(Boolean(_loc2_) && param1.key == this.namespaceURL)
{
this.processWatchedMetadataChange(null);
this.callback(undefined);
}
}
private function onValueChange(param1:MetadataEvent) : void
{
if(this.key)
{
if(this.key == param1.key)
{
this.callback(param1.value);
}
}
else
{
this.callback(param1.target as Metadata);
}
}
private function onValueAdd(param1:MetadataEvent) : void
{
if(this.key)
{
if(this.key == param1.key)
{
this.callback(param1.value);
}
}
else
{
this.callback(param1.target as Metadata);
}
}
private function onValueRemove(param1:MetadataEvent) : void
{
if(this.key)
{
if(this.key == param1.key)
{
this.callback(undefined);
}
}
else
{
this.callback(param1.target as Metadata);
}
}
}
}
@@ -0,0 +1,19 @@
package org.osmf.metadata
{
public class NonSynthesizingMetadata extends Metadata
{
private var _synthesizer:MetadataSynthesizer = new NullMetadataSynthesizer();
public function NonSynthesizingMetadata()
{
super();
}
override public function get synthesizer() : MetadataSynthesizer
{
return this._synthesizer;
}
}
}
@@ -0,0 +1,17 @@
package org.osmf.metadata
{
public class NullMetadataSynthesizer extends MetadataSynthesizer
{
public function NullMetadataSynthesizer()
{
super();
}
override public function synthesize(param1:String, param2:Metadata, param3:Vector.<Metadata>, param4:String, param5:Metadata) : Metadata
{
return null;
}
}
}
@@ -0,0 +1,28 @@
package org.osmf.metadata
{
public class TimelineMarker
{
private var _time:Number;
private var _duration:Number;
public function TimelineMarker(param1:Number, param2:Number = NaN)
{
super();
this._time = param1;
this._duration = param2;
}
public function get time() : Number
{
return this._time;
}
public function get duration() : Number
{
return this._duration;
}
}
}
@@ -0,0 +1,447 @@
package org.osmf.metadata
{
import flash.events.TimerEvent;
import flash.utils.Dictionary;
import flash.utils.Timer;
import org.osmf.events.MediaElementEvent;
import org.osmf.events.MetadataEvent;
import org.osmf.events.PlayEvent;
import org.osmf.events.SeekEvent;
import org.osmf.events.TimelineMetadataEvent;
import org.osmf.media.MediaElement;
import org.osmf.traits.MediaTraitType;
import org.osmf.traits.PlayState;
import org.osmf.traits.PlayTrait;
import org.osmf.traits.SeekTrait;
import org.osmf.traits.TimeTrait;
import org.osmf.utils.OSMFStrings;
public class TimelineMetadata extends Metadata
{
private static const CHECK_INTERVAL:Number = 100;
private static const TOLERANCE:Number = 0.25;
private var temporalKeyCollection:Vector.<Number>;
private var temporalValueCollection:Vector.<TimelineMarker>;
private var media:MediaElement;
private var timeTrait:TimeTrait;
private var seekTrait:SeekTrait;
private var playTrait:PlayTrait;
private var lastFiredTemporalMetadataIndex:int;
private var intervalTimer:Timer;
private var restartTimer:Boolean;
private var _enabled:Boolean;
private var durationTimers:Dictionary;
public function TimelineMetadata(param1:MediaElement)
{
super();
if(param1 == null)
{
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.NULL_PARAM));
}
this.media = param1;
this._enabled = true;
this.intervalTimer = new Timer(CHECK_INTERVAL);
this.intervalTimer.addEventListener(TimerEvent.TIMER,this.onIntervalTimer);
this.timeTrait = param1.getTrait(MediaTraitType.TIME) as TimeTrait;
this.seekTrait = param1.getTrait(MediaTraitType.SEEK) as SeekTrait;
this.setupTraitEventListener(MediaTraitType.SEEK);
this.playTrait = param1.getTrait(MediaTraitType.PLAY) as PlayTrait;
this.setupTraitEventListener(MediaTraitType.PLAY);
param1.addEventListener(MediaElementEvent.TRAIT_ADD,this.onTraitAdd);
param1.addEventListener(MediaElementEvent.TRAIT_REMOVE,this.onTraitRemove);
}
public function get numMarkers() : int
{
return this.temporalValueCollection ? int(this.temporalValueCollection.length) : 0;
}
public function getMarkerAt(param1:int) : TimelineMarker
{
if(param1 >= 0 && this.temporalValueCollection != null && param1 < this.temporalValueCollection.length)
{
return this.temporalValueCollection[param1];
}
return null;
}
public function addMarker(param1:TimelineMarker) : void
{
if(param1 == null)
{
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.INVALID_PARAM));
}
this.addValue("" + param1.time,param1);
}
public function removeMarker(param1:TimelineMarker) : TimelineMarker
{
if(param1 == null)
{
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.INVALID_PARAM));
}
return this.removeValue("" + param1.time);
}
override public function addValue(param1:String, param2:Object) : void
{
var _loc5_:int = 0;
var _loc3_:Number = new Number(param1);
var _loc4_:TimelineMarker = param2 as TimelineMarker;
if(param1 == null || isNaN(_loc3_) || _loc3_ < 0 || _loc4_ == null)
{
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.INVALID_PARAM));
}
if(this.temporalValueCollection == null)
{
this.temporalKeyCollection = new Vector.<Number>();
this.temporalKeyCollection.push(_loc3_);
this.temporalValueCollection = new Vector.<TimelineMarker>();
this.temporalValueCollection.push(param2);
}
else
{
_loc5_ = this.findTemporalMetadata(0,this.temporalValueCollection.length - 1,_loc3_);
if(_loc5_ < 0)
{
_loc5_ *= -1;
this.temporalKeyCollection.splice(_loc5_,0,_loc3_);
this.temporalValueCollection.splice(_loc5_,0,_loc4_);
}
else if(_loc5_ == 0 && _loc3_ != this.temporalKeyCollection[0])
{
this.temporalKeyCollection.splice(_loc5_,0,_loc3_);
this.temporalValueCollection.splice(_loc5_,0,_loc4_);
}
else
{
this.temporalKeyCollection[_loc5_] = _loc3_;
this.temporalValueCollection[_loc5_] = _loc4_;
}
}
this.enabled = true;
dispatchEvent(new MetadataEvent(MetadataEvent.VALUE_ADD,false,false,param1,_loc4_));
dispatchEvent(new TimelineMetadataEvent(TimelineMetadataEvent.MARKER_ADD,false,false,_loc4_));
}
override public function removeValue(param1:String) : *
{
if(param1 == null)
{
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.NULL_PARAM));
}
var _loc2_:Number = new Number(param1);
var _loc3_:* = null;
var _loc4_:int = this.temporalValueCollection ? this.findTemporalMetadata(0,this.temporalValueCollection.length - 1,_loc2_) : -1;
if(_loc4_ >= 0)
{
this.temporalKeyCollection.splice(_loc4_,1);
_loc3_ = this.temporalValueCollection.splice(_loc4_,1)[0];
if(this.temporalValueCollection.length == 0)
{
this.reset(false);
this.temporalValueCollection = null;
this.temporalKeyCollection = null;
}
dispatchEvent(new MetadataEvent(MetadataEvent.VALUE_REMOVE,false,false,param1,_loc3_));
dispatchEvent(new TimelineMetadataEvent(TimelineMetadataEvent.MARKER_REMOVE,false,false,_loc3_ as TimelineMarker));
}
return _loc3_;
}
override public function getValue(param1:String) : *
{
var _loc3_:int = 0;
var _loc4_:Number = NaN;
if(param1 == null)
{
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.NULL_PARAM));
}
var _loc2_:Number = new Number(param1);
if(!isNaN(_loc2_))
{
_loc3_ = 0;
while(_loc3_ < this.temporalKeyCollection.length)
{
_loc4_ = this.temporalKeyCollection[_loc3_];
if(_loc4_ == _loc2_)
{
return this.temporalValueCollection[_loc3_];
}
_loc3_++;
}
}
return null;
}
public function get enabled() : Boolean
{
return this._enabled;
}
public function set enabled(param1:Boolean) : void
{
this._enabled = param1;
this.reset(param1);
}
private function startTimer(param1:Boolean = true) : void
{
if(!param1)
{
this.intervalTimer.stop();
}
else if(this.timeTrait != null && this.temporalValueCollection != null && this.temporalValueCollection.length > 0 && this.restartTimer && this.enabled && !this.intervalTimer.running)
{
if(this.playTrait != null && this.playTrait.playState == PlayState.PLAYING)
{
this.intervalTimer.start();
}
}
}
private function reset(param1:Boolean) : void
{
this.lastFiredTemporalMetadataIndex = -1;
this.restartTimer = true;
this.intervalTimer.reset();
this.intervalTimer.delay = CHECK_INTERVAL;
if(param1)
{
this.startTimer();
}
}
private function checkForTemporalMetadata() : void
{
var _loc1_:Number = this.timeTrait.currentTime;
var _loc2_:int = this.findTemporalMetadata(this.lastFiredTemporalMetadataIndex + 1,this.temporalValueCollection.length - 1,_loc1_);
if(_loc2_ <= 0)
{
_loc2_ *= -1;
_loc2_ = _loc2_ > 0 ? int(_loc2_ - 1) : 0;
}
if(!this.checkTemporalMetadata(_loc2_,_loc1_) && _loc2_ + 1 < this.temporalValueCollection.length)
{
this.checkTemporalMetadata(_loc2_ + 1,_loc1_);
}
}
private function setupTraitEventListener(param1:String, param2:Boolean = true) : void
{
var _loc3_:PlayEvent = null;
if(param2)
{
if(param1 == MediaTraitType.SEEK && this.seekTrait != null)
{
this.seekTrait.addEventListener(SeekEvent.SEEKING_CHANGE,this.onSeekingChange);
}
else if(param1 == MediaTraitType.PLAY && this.playTrait != null)
{
this.playTrait.addEventListener(PlayEvent.PLAY_STATE_CHANGE,this.onPlayStateChange);
if(this.playTrait.playState == PlayState.PLAYING)
{
_loc3_ = new PlayEvent(PlayEvent.PLAY_STATE_CHANGE,false,false,PlayState.PLAYING);
this.onPlayStateChange(_loc3_);
}
}
}
else if(param1 == MediaTraitType.SEEK && this.seekTrait != null)
{
this.seekTrait.removeEventListener(SeekEvent.SEEKING_CHANGE,this.onSeekingChange);
}
else if(param1 == MediaTraitType.PLAY && this.playTrait != null)
{
this.playTrait.removeEventListener(PlayEvent.PLAY_STATE_CHANGE,this.onPlayStateChange);
}
}
private function onSeekingChange(param1:SeekEvent) : void
{
if(param1.seeking)
{
this.reset(true);
}
}
private function onPlayStateChange(param1:PlayEvent) : void
{
var _loc2_:Timer = null;
if(param1.playState == PlayState.PLAYING)
{
if(this.durationTimers != null)
{
for each(_loc2_ in this.durationTimers)
{
_loc2_.start();
}
}
this.startTimer();
}
else
{
if(this.durationTimers != null)
{
for each(_loc2_ in this.durationTimers)
{
_loc2_.stop();
}
}
this.startTimer(false);
}
}
private function findTemporalMetadata(param1:int, param2:int, param3:Number) : int
{
var _loc4_:int = 0;
if(param1 <= param2)
{
_loc4_ = (param1 + param2) / 2;
if(param3 == this.temporalKeyCollection[_loc4_])
{
return _loc4_;
}
if(param3 < this.temporalKeyCollection[_loc4_])
{
return this.findTemporalMetadata(param1,_loc4_ - 1,param3);
}
return this.findTemporalMetadata(_loc4_ + 1,param2,param3);
}
return -param1;
}
private function dispatchTemporalEvents(param1:int) : void
{
var marker:TimelineMarker = null;
var timer:Timer = null;
var endTime:Number = NaN;
var onDurationTimer:Function = null;
var index:int = param1;
marker = this.temporalValueCollection[index];
dispatchEvent(new TimelineMetadataEvent(TimelineMetadataEvent.MARKER_TIME_REACHED,false,false,marker));
if(marker.duration > 0)
{
onDurationTimer = function(param1:TimerEvent):void
{
if(Boolean(timeTrait) && timeTrait.currentTime >= endTime)
{
timer.removeEventListener(TimerEvent.TIMER,onDurationTimer);
delete durationTimers[marker];
dispatchEvent(new TimelineMetadataEvent(TimelineMetadataEvent.MARKER_DURATION_REACHED,false,false,marker));
}
};
timer = new Timer(CHECK_INTERVAL);
endTime = marker.time + marker.duration;
if(this.durationTimers == null)
{
this.durationTimers = new Dictionary();
}
this.durationTimers[marker] = timer;
timer.addEventListener(TimerEvent.TIMER,onDurationTimer);
timer.start();
}
}
private function checkTemporalMetadata(param1:int, param2:Number) : Boolean
{
var _loc4_:Number = NaN;
var _loc5_:Number = NaN;
var _loc6_:Number = NaN;
if(!this.temporalValueCollection || !this.temporalValueCollection.length)
{
return false;
}
var _loc3_:Boolean = false;
if(this.temporalValueCollection[param1].time >= param2 - TOLERANCE && this.temporalValueCollection[param1].time <= param2 + TOLERANCE && param1 != this.lastFiredTemporalMetadataIndex)
{
this.lastFiredTemporalMetadataIndex = param1;
this.dispatchTemporalEvents(param1);
_loc4_ = this.temporalKeyCollection[param1];
_loc5_ = this.calcNextTime(param1);
_loc6_ = (_loc5_ - _loc4_) * 1000 / 4;
_loc6_ = _loc6_ > CHECK_INTERVAL ? _loc6_ : CHECK_INTERVAL;
if(_loc4_ == _loc5_)
{
this.startTimer(false);
this.restartTimer = false;
}
else if(_loc6_ != this.intervalTimer.delay)
{
this.intervalTimer.reset();
this.intervalTimer.delay = _loc6_;
this.startTimer();
}
_loc3_ = true;
}
else if(this.intervalTimer.delay != CHECK_INTERVAL && param2 + this.intervalTimer.delay / 1000 > this.calcNextTime(param1))
{
this.intervalTimer.reset();
this.intervalTimer.delay = CHECK_INTERVAL;
this.startTimer();
}
return _loc3_;
}
private function calcNextTime(param1:int) : Number
{
return this.temporalValueCollection[param1 + 1 < this.temporalKeyCollection.length ? param1 + 1 : this.temporalKeyCollection.length - 1].time;
}
private function onIntervalTimer(param1:TimerEvent) : void
{
this.checkForTemporalMetadata();
}
private function onTraitAdd(param1:MediaElementEvent) : void
{
switch(param1.traitType)
{
case MediaTraitType.TIME:
this.timeTrait = this.media.getTrait(MediaTraitType.TIME) as TimeTrait;
this.startTimer();
break;
case MediaTraitType.SEEK:
this.seekTrait = this.media.getTrait(MediaTraitType.SEEK) as SeekTrait;
break;
case MediaTraitType.PLAY:
this.playTrait = this.media.getTrait(MediaTraitType.PLAY) as PlayTrait;
}
this.setupTraitEventListener(param1.traitType);
}
private function onTraitRemove(param1:MediaElementEvent) : void
{
this.setupTraitEventListener(param1.traitType,false);
switch(param1.traitType)
{
case MediaTraitType.TIME:
this.timeTrait = null;
if(this.media.hasOwnProperty("numChildren") == false)
{
this.startTimer(false);
}
break;
case MediaTraitType.SEEK:
this.seekTrait = null;
break;
case MediaTraitType.PLAY:
this.playTrait = null;
}
}
}
}