org.osmf.media

# MediaResourceBase - AS3 OSMF

Package | org.osmf.media
Class | public class MediaResourceBase
Inheritance | MediaResourceBase Object
Subclasses | PluginInfoResource, URLResource

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

A MediaResourceBase is a base class for media that serves as input to a MediaElement.

Different MediaElement instances can "handle" (i.e. process and present) different resource types (e.g. a URL vs. an array of streams), or even different variations of the same resource type (e.g. a URL with the ".jpg" extension vs. a URL with a ".mp3" extension).

A MediaResourceBase can also have an arbitrary set of descriptive metadata. Metadata is typically used to further qualify the resource so that each MediaElement can determine whether (and how) to present and process the resource.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | mediaType : String The MediaType, if any, of this resource. | MediaResourceBase
|  | metadataNamespaceURLs : Vector.<String> [read-only] A Vector containing the namespace URLs for all Metadata objects within this resource. | MediaResourceBase
|  | mimeType : String The MIME type, if any, of this resource. | MediaResourceBase

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | MediaResourceBase() Constructor. | MediaResourceBase
|  | addMetadataValue(namespaceURL:String, value:Object):void Adds a metadata value to this resource. | MediaResourceBase
|  | getMetadataValue(namespaceURL:String):Object Retrieves a metadata value from this resource. | MediaResourceBase
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | removeMetadataValue(namespaceURL:String):Object Removes a metadata value from this resource. | MediaResourceBase
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### mediaType

property

`mediaType:String`

The MediaType, if any, of this resource.

Implementation
`public function get mediaType():String`
`public function set mediaType(value:String):void`

### metadataNamespaceURLs

property

`metadataNamespaceURLs:Vector.<String>` [read-only]

A Vector containing the namespace URLs for all Metadata objects within this resource.

Implementation
`public function get metadataNamespaceURLs():Vector.<String>`

### mimeType

property

`mimeType:String`

The MIME type, if any, of this resource.

Implementation
`public function get mimeType():String`
`public function set mimeType(value:String):void`
Constructor Detail

### MediaResourceBase

()
Constructor

`public function MediaResourceBase()`

Constructor.

Method Detail

### addMetadataValue

()
method

`public function addMetadataValue(namespaceURL:String, value:Object):void`

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

Adds a metadata value to this resource.

Parameters

| `namespaceURL:String` — A URL with which this metadata is associated, and with which it can be retrieved. If there is metadata that is already associated with this URL, then it will be overwritten.
| `value:Object` — The metadata value. It is recommended that this be a strongly-typed class, rather than an untyped Object.

### getMetadataValue

()
method

`public function getMetadataValue(namespaceURL:String):Object`

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

Retrieves a metadata value from this resource.

Parameters

| `namespaceURL:String` — The URL with which the metadata is associated.

Returns

| `Object` — The retrieved metadata value, null if there is no metadata value associated with the specified namespace URL.

### removeMetadataValue

()
method

`public function removeMetadataValue(namespaceURL:String):Object`

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

Removes a metadata value from this resource.

Parameters

| `namespaceURL:String` — The URL with which the metadata value is associated.

Returns

| `Object` — The removed metadata value, null if there is no metadata value associated with the specified namespace URL.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00