Pacchetto | org.osmf.elements |
Classe | public class AudioElement |
Ereditarietà | AudioElement ![]() ![]() ![]() ![]() |
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | OSMF 1.0 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
AudioElement can load and present any MP3 or AAC file. It supports MP3 files over HTTP, as well as audio-only streams from Flash Media Server.
The basic steps for creating and using an AudioElement are:
- Create a new URLResource pointing to the URL of the audio stream or file containing the sound to be loaded.
- Create the new AudioElement, passing the URLResource as a parameter.
- Create a new MediaPlayer.
- Assign the AudioElement to the MediaPlayer's
media
property. - Control the media using the MediaPlayer's methods, properties, and events.
- When done with the AudioElement, set the MediaPlayer's
media
property to null. This will unload the AudioElement.
Elementi API correlati
Proprietà pubbliche
Proprietà | Definito da | ||
---|---|---|---|
![]() | constructor : Object
Un riferimento all'oggetto classe o alla funzione di costruzione per una determinata istanza di oggetto. | Object | |
![]() | metadataNamespaceURLs : Vector.<String> [sola lettura]
A Vector containing the namespace URLs for all Metadata
objects stored within this MediaElement. | MediaElement |
Proprietà protette
Metodi pubblici
Metodo | Definito da | ||
---|---|---|---|
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra un oggetto listener di eventi con un oggetto EventDispatcher, in modo che il listener riceva la notifica di un evento. | EventDispatcher | |
![]() |
Invia un evento nel flusso di eventi. | EventDispatcher | |
![]() |
Verifica se per l'oggetto EventDispatcher sono presenti listener registrati per un tipo specifico di evento. | EventDispatcher | |
![]() |
Indica se per un oggetto è definita una proprietà specifica. | Object | |
![]() |
Indica se un'istanza della classe Object si trova nella catena di prototipi dell'oggetto specificato come parametro. | Object | |
![]() |
Indica se la proprietà specificata esiste ed è enumerabile. | Object | |
![]() |
Rimuove un listener dall'oggetto EventDispatcher. | EventDispatcher | |
![]() |
Imposta la disponibilità di una proprietà dinamica per le operazioni cicliche. | Object | |
![]() |
Restituisce la rappresentazione in formato stringa di questo oggetto, formattato in base alle convenzioni specifiche per le versioni localizzate. | Object | |
![]() |
Restituisce la rappresentazione in formato stringa dell'oggetto specificato. | Object | |
![]() |
Restituisce il valore di base dell'oggetto specificato. | Object | |
![]() |
Verifica se un listener di eventi è registrato con questo oggetto EventDispatcher o qualsiasi suo antenato per il tipo di evento specificato. | EventDispatcher |
Metodi protetti
Eventi
Descrizione delle proprietà
Descrizione della funzione di costruzione
AudioElementExample.as
package { import flash.display.Sprite; import org.osmf.elements.AudioElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; public class AudioElementExample extends Sprite { public function AudioElementExample() { super(); var mediaPlayer:MediaPlayer = new MediaPlayer(); var audioElement:AudioElement = new AudioElement(); audioElement.resource = new URLResource("http://mediapm.edgesuite.net/osmf/content/test/train_1500.mp3"); mediaPlayer.media = audioElement; } } }
Tue Jun 12 2018, 02:44 PM Z