Packagecom.adobe.mediacore
Classpublic final class MediaResource
InheritanceMediaResource Inheritance Object

Class wrapping all information about a media resource.



Public Properties
 PropertyDefined By
  metadata : Metadata
[read-only] Resource custom information.
MediaResource
  type : String
[read-only] Type of the media resource.
MediaResource
  url : String
[read-only] Returns the URL where the media manifest/playlist can be found.
MediaResource
Public Methods
 MethodDefined By
  
MediaResource(url:String, type:String, metadata:Metadata)
Default constructor.
MediaResource
  
[static]
MediaResource
  
createFromUrl(url:String, metadata:Metadata):MediaResource
[static] Helper function for creating a media resource instance.
MediaResource
  
equals(otherMediaResource:MediaResource):Boolean
Checks if is equal with other media resource.
MediaResource
  
toString():String
Returns a String representation of the current media resource.
MediaResource
Property Detail
metadataproperty
metadata:Metadata  [read-only]

Resource custom information.


Implementation
    public function get metadata():Metadata
typeproperty 
type:String  [read-only]

Type of the media resource. Usually the type of the resource can be detected from the provided url, but sometimes when custom naming schemes are involved this is not possible.


Implementation
    public function get type():String
urlproperty 
url:String  [read-only]

Returns the URL where the media manifest/playlist can be found.


Implementation
    public function get url():String
Constructor Detail
MediaResource()Constructor
public function MediaResource(url:String, type:String, metadata:Metadata)

Default constructor.

Parameters
url:String — the url where the manifest/playlist of media is available
 
type:String — the type of the resource.
 
metadata:Metadata — the custom information associated with this resource

Throws
ArgumentError — if provided url is null or empty.
Method Detail
createFromMetadata()method
public static function createFromMetadata(metadata:Metadata, type:String):MediaResource

Parameters

metadata:Metadata
 
type:String

Returns
MediaResource
createFromUrl()method 
public static function createFromUrl(url:String, metadata:Metadata):MediaResource

Helper function for creating a media resource instance.

Parameters

url:String — the url where the manifest/playlist of media is available
 
metadata:Metadata — the custom information associated with this resource

Returns
MediaResource — a new MediaResource instance

Throws
ArgumentError — if provided url is null or empty or no supported type was extracted from the specified url.
equals()method 
public function equals(otherMediaResource:MediaResource):Boolean

Checks if is equal with other media resource. The metadata property is ignored during comparison, only the url and the type are used.

Parameters

otherMediaResource:MediaResource — the other media resource to be compared with.

Returns
Boolean — return true if both objects have the same urls and the same type and false otherwise.
toString()method 
public function toString():String

Returns a String representation of the current media resource. As a media resource can have a significant amount of custom metadata associated with it, we will not include metadata content in this representation.

Returns
String — a string containing the url and the type of the resource