Package | com.akamai.media |
Class | public class MediaInspector |
Inheritance | MediaInspector MediaInspectorBase flash.events.EventDispatcher |
Method | Defined By | ||
---|---|---|---|
inspect(resource:String, maxBytesToRead:int, timeout:Number):void [override]
An asynchronous method to inspect a resource and try to determine
which of the media types enumerated in the MediaType class the
resource is referring to. | MediaInspector |
Constant | Defined By | ||
---|---|---|---|
INVALID_MAX_BYTES_TO_READ_ARGUMENT : String = Invalid argument for maxBytesToRead passed to method [static] | MediaInspectorBase | ||
INVALID_TIMEOUT_ARGUMENT : String = Invalid argument for timeout passed to method [static] | MediaInspectorBase | ||
TIMEOUT : Number = 5000 [static] | MediaInspector |
inspect | () | method |
override public function inspect(resource:String, maxBytesToRead:int, timeout:Number):void
An asynchronous method to inspect a resource and try to determine which of the media types enumerated in the MediaType class the resource is referring to.
Parameters
resource:String — The URL resource to inspect.
| |
maxBytesToRead:int (default = NaN ) — The maximum bytes the method will inspect
before giving up. The default is 2 kilobytes. Note this only applies to cases
where the class cannot determine the type by either the protocol or
the file extension.
| |
timeout:Number (default = NaN ) — The number of milliseconds the class should wait
for a request response. The default is 5000 (5 seconds).
|
See also
TIMEOUT | Constant |
public static const TIMEOUT:Number = 5000
mediaInspector = new MediaInspector(); mediaInspector.addEventListener(MediaInspectorEvent.COMPLETE, onComplete); mediaInspector.addEventListener(MediaInspectorEvent.ERROR, onError); mediaInspector.addEventListener(MediaInspectorEvent.TIMEOUT, onTimeout); mediaInspector.inspect(url); private function onComplete(event:MediaInspectorEvent):void { switch (event.mediaType) { case MediaType.AMD_LIVE: break; case MediaType.AMD_ONDEMAND: break; case MediaType.AMD_PROGRESSIVE: break; case MediaType.FMS_MBR: break; case MediaType.HDN_MBR: break; case MediaType.HDN_SBR: break; case MediaType.HDN_ADOBE_HTTP: break; case MediaType.UNKNOWN: break; } }