mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-21 01:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,84 @@
|
||||
package org.osmf.media.pluginClasses
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import org.osmf.elements.SWFLoader;
|
||||
import org.osmf.elements.loaderClasses.LoaderLoadTrait;
|
||||
import org.osmf.events.LoaderEvent;
|
||||
import org.osmf.events.MediaErrorEvent;
|
||||
import org.osmf.media.MediaFactory;
|
||||
import org.osmf.media.MediaResourceBase;
|
||||
import org.osmf.media.PluginInfo;
|
||||
import org.osmf.traits.LoadState;
|
||||
import org.osmf.traits.LoadTrait;
|
||||
|
||||
internal class DynamicPluginLoader extends PluginLoader
|
||||
{
|
||||
|
||||
private static const PLUGININFO_PROPERTY_NAME:String = "pluginInfo";
|
||||
|
||||
public function DynamicPluginLoader(param1:MediaFactory, param2:String)
|
||||
{
|
||||
super(param1,param2);
|
||||
}
|
||||
|
||||
override public function canHandleResource(param1:MediaResourceBase) : Boolean
|
||||
{
|
||||
return new SWFLoader().canHandleResource(param1);
|
||||
}
|
||||
|
||||
override protected function executeLoad(param1:LoadTrait) : void
|
||||
{
|
||||
var swfLoader:SWFLoader = null;
|
||||
var loaderLoadTrait:LoaderLoadTrait = null;
|
||||
var onSWFLoaderStateChange:Function = null;
|
||||
var onLoadError:Function = null;
|
||||
var loadTrait:LoadTrait = param1;
|
||||
onSWFLoaderStateChange = function(param1:LoaderEvent):void
|
||||
{
|
||||
var _loc2_:DisplayObject = null;
|
||||
var _loc3_:PluginInfo = null;
|
||||
if(param1.newState == LoadState.READY)
|
||||
{
|
||||
swfLoader.removeEventListener(LoaderEvent.LOAD_STATE_CHANGE,onSWFLoaderStateChange);
|
||||
loaderLoadTrait.removeEventListener(MediaErrorEvent.MEDIA_ERROR,onLoadError);
|
||||
_loc2_ = loaderLoadTrait.loader.content;
|
||||
_loc3_ = _loc2_[PLUGININFO_PROPERTY_NAME] as PluginInfo;
|
||||
loadFromPluginInfo(loadTrait,_loc3_,loaderLoadTrait.loader);
|
||||
}
|
||||
else if(param1.newState == LoadState.LOAD_ERROR)
|
||||
{
|
||||
swfLoader.removeEventListener(LoaderEvent.LOAD_STATE_CHANGE,onSWFLoaderStateChange);
|
||||
updateLoadTrait(loadTrait,param1.newState);
|
||||
}
|
||||
};
|
||||
onLoadError = function(param1:MediaErrorEvent):void
|
||||
{
|
||||
loaderLoadTrait.removeEventListener(MediaErrorEvent.MEDIA_ERROR,onLoadError);
|
||||
loadTrait.dispatchEvent(param1.clone());
|
||||
};
|
||||
updateLoadTrait(loadTrait,LoadState.LOADING);
|
||||
swfLoader = new SWFLoader(true);
|
||||
swfLoader.validateLoadedContentFunction = this.validateLoadedContent;
|
||||
swfLoader.addEventListener(LoaderEvent.LOAD_STATE_CHANGE,onSWFLoaderStateChange);
|
||||
loaderLoadTrait = new LoaderLoadTrait(swfLoader,loadTrait.resource);
|
||||
loaderLoadTrait.addEventListener(MediaErrorEvent.MEDIA_ERROR,onLoadError);
|
||||
swfLoader.load(loaderLoadTrait);
|
||||
}
|
||||
|
||||
override protected function executeUnload(param1:LoadTrait) : void
|
||||
{
|
||||
updateLoadTrait(param1,LoadState.UNLOADING);
|
||||
var _loc2_:PluginLoadTrait = param1 as PluginLoadTrait;
|
||||
unloadFromPluginInfo(_loc2_.pluginInfo);
|
||||
_loc2_.loader.unloadAndStop();
|
||||
updateLoadTrait(param1,LoadState.UNINITIALIZED);
|
||||
}
|
||||
|
||||
private function validateLoadedContent(param1:DisplayObject) : Boolean
|
||||
{
|
||||
var _loc2_:Object = param1.hasOwnProperty(PLUGININFO_PROPERTY_NAME) ? param1[PLUGININFO_PROPERTY_NAME] : null;
|
||||
return _loc2_ != null ? isPluginCompatible(_loc2_) : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.osmf.media.pluginClasses
|
||||
{
|
||||
import org.osmf.media.LoadableElementBase;
|
||||
import org.osmf.media.MediaResourceBase;
|
||||
import org.osmf.traits.LoadTrait;
|
||||
import org.osmf.traits.LoaderBase;
|
||||
|
||||
internal class PluginElement extends LoadableElementBase
|
||||
{
|
||||
|
||||
public function PluginElement(param1:PluginLoader, param2:MediaResourceBase = null)
|
||||
{
|
||||
super(param2,param1);
|
||||
}
|
||||
|
||||
override protected function createLoadTrait(param1:MediaResourceBase, param2:LoaderBase) : LoadTrait
|
||||
{
|
||||
return new PluginLoadTrait(param2,param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.osmf.media.pluginClasses
|
||||
{
|
||||
import org.osmf.media.MediaElement;
|
||||
|
||||
internal class PluginEntry
|
||||
{
|
||||
|
||||
private var _pluginElement:MediaElement;
|
||||
|
||||
private var _state:PluginLoadingState;
|
||||
|
||||
public function PluginEntry(param1:MediaElement, param2:PluginLoadingState)
|
||||
{
|
||||
super();
|
||||
this._pluginElement = param1;
|
||||
this._state = param2;
|
||||
}
|
||||
|
||||
public function get pluginElement() : MediaElement
|
||||
{
|
||||
return this._pluginElement;
|
||||
}
|
||||
|
||||
public function get state() : PluginLoadingState
|
||||
{
|
||||
return this._state;
|
||||
}
|
||||
|
||||
public function set state(param1:PluginLoadingState) : void
|
||||
{
|
||||
this._state = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.osmf.media.pluginClasses
|
||||
{
|
||||
import flash.display.Loader;
|
||||
import org.osmf.media.MediaResourceBase;
|
||||
import org.osmf.media.PluginInfo;
|
||||
import org.osmf.traits.LoadTrait;
|
||||
import org.osmf.traits.LoaderBase;
|
||||
|
||||
internal class PluginLoadTrait extends LoadTrait
|
||||
{
|
||||
|
||||
private var _pluginInfo:PluginInfo;
|
||||
|
||||
private var _loader:Loader;
|
||||
|
||||
public function PluginLoadTrait(param1:LoaderBase, param2:MediaResourceBase)
|
||||
{
|
||||
super(param1,param2);
|
||||
}
|
||||
|
||||
public function get pluginInfo() : PluginInfo
|
||||
{
|
||||
return this._pluginInfo;
|
||||
}
|
||||
|
||||
public function set pluginInfo(param1:PluginInfo) : void
|
||||
{
|
||||
this._pluginInfo = param1;
|
||||
}
|
||||
|
||||
public function get loader() : Loader
|
||||
{
|
||||
return this._loader;
|
||||
}
|
||||
|
||||
public function set loader(param1:Loader) : void
|
||||
{
|
||||
this._loader = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
package org.osmf.media.pluginClasses
|
||||
{
|
||||
import flash.display.Loader;
|
||||
import org.osmf.events.MediaError;
|
||||
import org.osmf.events.MediaErrorCodes;
|
||||
import org.osmf.events.MediaErrorEvent;
|
||||
import org.osmf.media.MediaFactory;
|
||||
import org.osmf.media.MediaFactoryItem;
|
||||
import org.osmf.media.PluginInfo;
|
||||
import org.osmf.traits.LoadState;
|
||||
import org.osmf.traits.LoadTrait;
|
||||
import org.osmf.traits.LoaderBase;
|
||||
import org.osmf.utils.Version;
|
||||
|
||||
internal class PluginLoader extends LoaderBase
|
||||
{
|
||||
|
||||
private static const FRAMEWORK_VERSION_PROPERTY_NAME:String = "frameworkVersion";
|
||||
|
||||
private static const IS_FRAMEWORK_VERSION_SUPPORTED_PROPERTY_NAME:String = "isFrameworkVersionSupported";
|
||||
|
||||
private var minimumSupportedFrameworkVersion:String;
|
||||
|
||||
private var mediaFactory:MediaFactory;
|
||||
|
||||
public function PluginLoader(param1:MediaFactory, param2:String)
|
||||
{
|
||||
super();
|
||||
this.mediaFactory = param1;
|
||||
this.minimumSupportedFrameworkVersion = param2;
|
||||
}
|
||||
|
||||
protected function unloadFromPluginInfo(param1:PluginInfo) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:MediaFactoryItem = null;
|
||||
var _loc4_:MediaFactoryItem = null;
|
||||
if(param1 != null)
|
||||
{
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < param1.numMediaFactoryItems)
|
||||
{
|
||||
_loc3_ = param1.getMediaFactoryItemAt(_loc2_);
|
||||
_loc4_ = this.mediaFactory.getItemById(_loc3_.id);
|
||||
if(_loc4_ != null)
|
||||
{
|
||||
this.mediaFactory.removeItem(_loc4_);
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function loadFromPluginInfo(param1:LoadTrait, param2:PluginInfo, param3:Loader = null) : void
|
||||
{
|
||||
var passedMediaFactory:MediaFactory = null;
|
||||
var i:int = 0;
|
||||
var pluginLoadTrait:PluginLoadTrait = null;
|
||||
var item:MediaFactoryItem = null;
|
||||
var loadTrait:LoadTrait = param1;
|
||||
var pluginInfo:PluginInfo = param2;
|
||||
var loader:Loader = param3;
|
||||
var invalidImplementation:Boolean = false;
|
||||
if(pluginInfo != null)
|
||||
{
|
||||
if(this.isPluginCompatible(pluginInfo))
|
||||
{
|
||||
try
|
||||
{
|
||||
passedMediaFactory = loadTrait.resource.getMetadataValue(PluginInfo.PLUGIN_MEDIAFACTORY_NAMESPACE) as MediaFactory;
|
||||
if(passedMediaFactory == null)
|
||||
{
|
||||
loadTrait.resource.addMetadataValue(PluginInfo.PLUGIN_MEDIAFACTORY_NAMESPACE,this.mediaFactory);
|
||||
}
|
||||
pluginInfo.initializePlugin(loadTrait.resource);
|
||||
i = 0;
|
||||
while(i < pluginInfo.numMediaFactoryItems)
|
||||
{
|
||||
item = pluginInfo.getMediaFactoryItemAt(i);
|
||||
if(item == null)
|
||||
{
|
||||
throw new RangeError();
|
||||
}
|
||||
this.mediaFactory.addItem(item);
|
||||
i++;
|
||||
}
|
||||
pluginLoadTrait = loadTrait as PluginLoadTrait;
|
||||
pluginLoadTrait.pluginInfo = pluginInfo;
|
||||
pluginLoadTrait.loader = loader;
|
||||
updateLoadTrait(pluginLoadTrait,LoadState.READY);
|
||||
}
|
||||
catch(error:RangeError)
|
||||
{
|
||||
invalidImplementation = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
updateLoadTrait(loadTrait,LoadState.LOAD_ERROR);
|
||||
loadTrait.dispatchEvent(new MediaErrorEvent(MediaErrorEvent.MEDIA_ERROR,false,false,new MediaError(MediaErrorCodes.PLUGIN_VERSION_INVALID)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
invalidImplementation = true;
|
||||
}
|
||||
if(invalidImplementation)
|
||||
{
|
||||
updateLoadTrait(loadTrait,LoadState.LOAD_ERROR);
|
||||
loadTrait.dispatchEvent(new MediaErrorEvent(MediaErrorEvent.MEDIA_ERROR,false,false,new MediaError(MediaErrorCodes.PLUGIN_IMPLEMENTATION_INVALID)));
|
||||
}
|
||||
}
|
||||
|
||||
protected function isPluginCompatible(param1:Object) : Boolean
|
||||
{
|
||||
var _loc5_:Function = null;
|
||||
var _loc2_:Boolean = false;
|
||||
var _loc3_:String = param1.hasOwnProperty(FRAMEWORK_VERSION_PROPERTY_NAME) ? param1[FRAMEWORK_VERSION_PROPERTY_NAME] : null;
|
||||
var _loc4_:Boolean = this.isPluginVersionSupported(_loc3_);
|
||||
if(_loc4_)
|
||||
{
|
||||
_loc5_ = param1.hasOwnProperty(IS_FRAMEWORK_VERSION_SUPPORTED_PROPERTY_NAME) ? param1[IS_FRAMEWORK_VERSION_SUPPORTED_PROPERTY_NAME] as Function : null;
|
||||
if(_loc5_ != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
_loc2_ = _loc5_(Version.version);
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
private function isPluginVersionSupported(param1:String) : Boolean
|
||||
{
|
||||
if(param1 == null || param1.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var _loc2_:Object = VersionUtils.parseVersionString(this.minimumSupportedFrameworkVersion);
|
||||
var _loc3_:Object = VersionUtils.parseVersionString(param1);
|
||||
return _loc3_.major > _loc2_.major || _loc3_.major == _loc2_.major && _loc3_.minor >= _loc2_.minor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.osmf.media.pluginClasses
|
||||
{
|
||||
internal class PluginLoadingState
|
||||
{
|
||||
|
||||
public static const LOADING:PluginLoadingState = new PluginLoadingState("Loading");
|
||||
|
||||
public static const LOADED:PluginLoadingState = new PluginLoadingState("Loaded");
|
||||
|
||||
private var _state:String;
|
||||
|
||||
public function PluginLoadingState(param1:String)
|
||||
{
|
||||
super();
|
||||
this._state = param1;
|
||||
}
|
||||
|
||||
public function get state() : String
|
||||
{
|
||||
return this._state;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
package org.osmf.media.pluginClasses
|
||||
{
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.utils.Dictionary;
|
||||
import org.osmf.events.LoadEvent;
|
||||
import org.osmf.events.MediaErrorEvent;
|
||||
import org.osmf.events.MediaFactoryEvent;
|
||||
import org.osmf.events.PluginManagerEvent;
|
||||
import org.osmf.media.MediaElement;
|
||||
import org.osmf.media.MediaFactory;
|
||||
import org.osmf.media.MediaFactoryItem;
|
||||
import org.osmf.media.MediaResourceBase;
|
||||
import org.osmf.media.PluginInfoResource;
|
||||
import org.osmf.media.URLResource;
|
||||
import org.osmf.traits.LoadState;
|
||||
import org.osmf.traits.LoadTrait;
|
||||
import org.osmf.traits.MediaTraitType;
|
||||
import org.osmf.utils.OSMFStrings;
|
||||
import org.osmf.utils.Version;
|
||||
|
||||
public class PluginManager extends EventDispatcher
|
||||
{
|
||||
|
||||
private static const STATIC_PLUGIN_MEDIA_INFO_ID:String = "org.osmf.plugins.StaticPluginLoader";
|
||||
|
||||
private static const DYNAMIC_PLUGIN_MEDIA_INFO_ID:String = "org.osmf.plugins.DynamicPluginLoader";
|
||||
|
||||
private var _mediaFactory:MediaFactory;
|
||||
|
||||
private var _pluginFactory:MediaFactory;
|
||||
|
||||
private var _pluginMap:Dictionary;
|
||||
|
||||
private var _pluginList:Vector.<PluginEntry>;
|
||||
|
||||
private var notificationFunctions:Vector.<Function>;
|
||||
|
||||
private var createdElements:Dictionary;
|
||||
|
||||
private var minimumSupportedFrameworkVersion:String;
|
||||
|
||||
private var staticPluginLoader:StaticPluginLoader;
|
||||
|
||||
private var dynamicPluginLoader:DynamicPluginLoader;
|
||||
|
||||
public function PluginManager(param1:MediaFactory)
|
||||
{
|
||||
super();
|
||||
this._mediaFactory = param1;
|
||||
this._mediaFactory.addEventListener(MediaFactoryEvent.MEDIA_ELEMENT_CREATE,this.onMediaElementCreate);
|
||||
this.minimumSupportedFrameworkVersion = Version.lastAPICompatibleVersion;
|
||||
this.initPluginFactory();
|
||||
this._pluginMap = new Dictionary();
|
||||
this._pluginList = new Vector.<PluginEntry>();
|
||||
}
|
||||
|
||||
public function loadPlugin(param1:MediaResourceBase) : void
|
||||
{
|
||||
var identifier:Object = null;
|
||||
var pluginEntry:PluginEntry = null;
|
||||
var onLoadStateChange:Function = null;
|
||||
var onMediaError:Function = null;
|
||||
var pluginElement:MediaElement = null;
|
||||
var loadTrait:LoadTrait = null;
|
||||
var resource:MediaResourceBase = param1;
|
||||
onLoadStateChange = function(param1:LoadEvent):void
|
||||
{
|
||||
var _loc2_:PluginLoadTrait = null;
|
||||
if(param1.loadState == LoadState.READY)
|
||||
{
|
||||
pluginEntry.state = PluginLoadingState.LOADED;
|
||||
_pluginList.push(pluginEntry);
|
||||
_loc2_ = pluginElement.getTrait(MediaTraitType.LOAD) as PluginLoadTrait;
|
||||
if(_loc2_.pluginInfo.mediaElementCreationNotificationFunction != null)
|
||||
{
|
||||
invokeMediaElementCreationNotificationForCreatedMediaElements(_loc2_.pluginInfo.mediaElementCreationNotificationFunction);
|
||||
if(notificationFunctions == null)
|
||||
{
|
||||
notificationFunctions = new Vector.<Function>();
|
||||
}
|
||||
notificationFunctions.push(_loc2_.pluginInfo.mediaElementCreationNotificationFunction);
|
||||
}
|
||||
dispatchEvent(new PluginManagerEvent(PluginManagerEvent.PLUGIN_LOAD,false,false,resource));
|
||||
}
|
||||
else if(param1.loadState == LoadState.LOAD_ERROR)
|
||||
{
|
||||
delete _pluginMap[identifier];
|
||||
dispatchEvent(new PluginManagerEvent(PluginManagerEvent.PLUGIN_LOAD_ERROR,false,false,resource));
|
||||
}
|
||||
};
|
||||
onMediaError = function(param1:MediaErrorEvent):void
|
||||
{
|
||||
dispatchEvent(param1.clone());
|
||||
};
|
||||
if(resource == null)
|
||||
{
|
||||
throw new ArgumentError(OSMFStrings.getString(OSMFStrings.INVALID_PARAM));
|
||||
}
|
||||
identifier = this.getPluginIdentifier(resource);
|
||||
pluginEntry = this._pluginMap[identifier] as PluginEntry;
|
||||
if(pluginEntry != null)
|
||||
{
|
||||
dispatchEvent(new PluginManagerEvent(PluginManagerEvent.PLUGIN_LOAD,false,false,resource));
|
||||
}
|
||||
else
|
||||
{
|
||||
pluginElement = this._pluginFactory.createMediaElement(resource);
|
||||
if(pluginElement != null)
|
||||
{
|
||||
pluginEntry = new PluginEntry(pluginElement,PluginLoadingState.LOADING);
|
||||
this._pluginMap[identifier] = pluginEntry;
|
||||
loadTrait = pluginElement.getTrait(MediaTraitType.LOAD) as LoadTrait;
|
||||
if(loadTrait != null)
|
||||
{
|
||||
loadTrait.addEventListener(LoadEvent.LOAD_STATE_CHANGE,onLoadStateChange);
|
||||
loadTrait.addEventListener(MediaErrorEvent.MEDIA_ERROR,onMediaError);
|
||||
loadTrait.load();
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatchEvent(new PluginManagerEvent(PluginManagerEvent.PLUGIN_LOAD_ERROR,false,false,resource));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatchEvent(new PluginManagerEvent(PluginManagerEvent.PLUGIN_LOAD_ERROR,false,false,resource));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get mediaFactory() : MediaFactory
|
||||
{
|
||||
return this._mediaFactory;
|
||||
}
|
||||
|
||||
private function getPluginIdentifier(param1:MediaResourceBase) : Object
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
if(param1 is URLResource)
|
||||
{
|
||||
_loc2_ = (param1 as URLResource).url;
|
||||
}
|
||||
else if(param1 is PluginInfoResource)
|
||||
{
|
||||
_loc2_ = (param1 as PluginInfoResource).pluginInfo;
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
private function initPluginFactory() : void
|
||||
{
|
||||
this._pluginFactory = new MediaFactory();
|
||||
this.staticPluginLoader = new StaticPluginLoader(this.mediaFactory,this.minimumSupportedFrameworkVersion);
|
||||
this.dynamicPluginLoader = new DynamicPluginLoader(this.mediaFactory,this.minimumSupportedFrameworkVersion);
|
||||
var _loc1_:MediaFactoryItem = new MediaFactoryItem(STATIC_PLUGIN_MEDIA_INFO_ID,this.staticPluginLoader.canHandleResource,this.createStaticPluginElement);
|
||||
this._pluginFactory.addItem(_loc1_);
|
||||
var _loc2_:MediaFactoryItem = new MediaFactoryItem(DYNAMIC_PLUGIN_MEDIA_INFO_ID,this.dynamicPluginLoader.canHandleResource,this.createDynamicPluginElement);
|
||||
this._pluginFactory.addItem(_loc2_);
|
||||
}
|
||||
|
||||
private function createStaticPluginElement() : MediaElement
|
||||
{
|
||||
return new PluginElement(this.staticPluginLoader);
|
||||
}
|
||||
|
||||
private function createDynamicPluginElement() : MediaElement
|
||||
{
|
||||
return new PluginElement(this.dynamicPluginLoader);
|
||||
}
|
||||
|
||||
private function onMediaElementCreate(param1:MediaFactoryEvent) : void
|
||||
{
|
||||
this.invokeMediaElementCreationNotifications(param1.mediaElement);
|
||||
if(this.createdElements == null)
|
||||
{
|
||||
this.createdElements = new Dictionary(true);
|
||||
}
|
||||
this.createdElements[param1.mediaElement] = true;
|
||||
}
|
||||
|
||||
private function invokeMediaElementCreationNotifications(param1:MediaElement) : void
|
||||
{
|
||||
var _loc2_:Function = null;
|
||||
for each(_loc2_ in this.notificationFunctions)
|
||||
{
|
||||
this.invokeMediaElementCreationNotificationFunction(_loc2_,param1);
|
||||
}
|
||||
}
|
||||
|
||||
private function invokeMediaElementCreationNotificationFunction(param1:Function, param2:MediaElement) : void
|
||||
{
|
||||
try
|
||||
{
|
||||
param1.call(null,param2);
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private function invokeMediaElementCreationNotificationForCreatedMediaElements(param1:Function) : void
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
for(_loc2_ in this.createdElements)
|
||||
{
|
||||
this.invokeMediaElementCreationNotificationFunction(param1,_loc2_ as MediaElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.osmf.media.pluginClasses
|
||||
{
|
||||
import org.osmf.media.MediaFactory;
|
||||
import org.osmf.media.MediaResourceBase;
|
||||
import org.osmf.media.PluginInfo;
|
||||
import org.osmf.media.PluginInfoResource;
|
||||
import org.osmf.traits.LoadState;
|
||||
import org.osmf.traits.LoadTrait;
|
||||
|
||||
internal class StaticPluginLoader extends PluginLoader
|
||||
{
|
||||
|
||||
public function StaticPluginLoader(param1:MediaFactory, param2:String)
|
||||
{
|
||||
super(param1,param2);
|
||||
}
|
||||
|
||||
override public function canHandleResource(param1:MediaResourceBase) : Boolean
|
||||
{
|
||||
return param1 is PluginInfoResource;
|
||||
}
|
||||
|
||||
override protected function executeLoad(param1:LoadTrait) : void
|
||||
{
|
||||
updateLoadTrait(param1,LoadState.LOADING);
|
||||
var _loc2_:PluginInfoResource = param1.resource as PluginInfoResource;
|
||||
var _loc3_:PluginInfo = _loc2_.pluginInfo;
|
||||
loadFromPluginInfo(param1,_loc3_);
|
||||
}
|
||||
|
||||
override protected function executeUnload(param1:LoadTrait) : void
|
||||
{
|
||||
var _loc2_:PluginLoadTrait = param1 as PluginLoadTrait;
|
||||
var _loc3_:PluginInfo = _loc2_.pluginInfo;
|
||||
updateLoadTrait(param1,LoadState.UNLOADING);
|
||||
unloadFromPluginInfo(_loc3_);
|
||||
updateLoadTrait(param1,LoadState.UNINITIALIZED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.osmf.media.pluginClasses
|
||||
{
|
||||
public class VersionUtils
|
||||
{
|
||||
|
||||
public function VersionUtils()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function parseVersionString(param1:String) : Object
|
||||
{
|
||||
var _loc2_:Array = param1.split(".");
|
||||
var _loc3_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
if(_loc2_.length >= 1)
|
||||
{
|
||||
_loc3_ = parseInt(_loc2_[0]);
|
||||
}
|
||||
if(_loc2_.length >= 2)
|
||||
{
|
||||
_loc4_ = parseInt(_loc2_[1]);
|
||||
if(_loc4_ < 10)
|
||||
{
|
||||
_loc4_ *= 10;
|
||||
}
|
||||
}
|
||||
return {
|
||||
"major":_loc3_,
|
||||
"minor":_loc4_
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user