Package | com.distriqt.extension.mediaplayer |
Class | public final class MediaPlayer |
Inheritance | MediaPlayer ![]() |
This class represents the MediaPlayer extension. This extension requires AIR 4.0 +
Property | Defined By | ||
---|---|---|---|
implementation : String [read-only]
The implementation currently in use. | MediaPlayer | ||
isOtherAudioPlaying : Boolean [read-only]
A Boolean value that indicates whether another app is playing audio. | MediaPlayer | ||
isSupported : Boolean [static] [read-only]
Whether the current device supports the extensions functionality
| MediaPlayer | ||
nativeVersion : String [read-only]
The native version string of the native extension. | MediaPlayer | ||
remoteCommandCenter : RemoteCommandCenter [read-only]
Access to the remote command center functionality
| MediaPlayer | ||
service : MediaPlayer [static] [read-only]
The singleton instance of the MediaPlayer class. | MediaPlayer | ||
soundPool : SoundPool [read-only]
Access the sound pool to playback sound effects
| MediaPlayer | ||
systemControl : SystemControl [read-only]
| MediaPlayer | ||
utils : MediaUtils [read-only]
Access to the media utilies
| MediaPlayer | ||
version : String [read-only]
The version of this extension. | MediaPlayer |
Method | Defined By | ||
---|---|---|---|
Constructor
You should not call this directly, but instead use the singleton access
| MediaPlayer | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void [override] | MediaPlayer | ||
Create an instance of an AudioPlayer using the specified options. | MediaPlayer | ||
Create an instance of a MediaPlayerView using the specified options. | MediaPlayer | ||
dispose():void
Disposes the extension and releases any allocated resources. | MediaPlayer | ||
init(key:String):void Deprecated: You no longer need to use an application key [static]
Initialises the extension class for use with the provided key. | MediaPlayer | ||
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void [override] | MediaPlayer |
Constant | Defined By | ||
---|---|---|---|
CONTROLS_BASIC : String = controls:basic Deprecated: Please Use MediaPlayerOptions.CONTROLS_BASIC [static]
Basic controls are displayed. | MediaPlayer | ||
CONTROLS_EMBEDDED : String = controls:embedded Deprecated: Please Use MediaPlayerOptions.CONTROLS_EMBEDDED [static]
Controls for an embedded view are displayed. | MediaPlayer | ||
CONTROLS_FULLSCREEN : String = controls:fullscreen Deprecated: Please Use MediaPlayerOptions.CONTROLS_FULLSCREEN [static]
Controls for fullscreen playback are displayed. | MediaPlayer | ||
CONTROLS_NONE : String = controls:none Deprecated: Please Use MediaPlayerOptions.CONTROLS_NONE [static]
No controls are displayed. | MediaPlayer | ||
EXT_CONTEXT_ID : String = com.distriqt.MediaPlayer [static] | MediaPlayer | ||
VERSION : String = 5.0.0 [static] | MediaPlayer |
implementation | property |
implementation:String
[read-only]
The implementation currently in use. This should be one of the following depending on the platform in use and the functionality supported by this extension:
Android
iOS
default
unknown
public function get implementation():String
isOtherAudioPlaying | property |
isOtherAudioPlaying:Boolean
[read-only] A Boolean value that indicates whether another app is playing audio. Useful to check if another service is playing music in the background.
public function get isOtherAudioPlaying():Boolean
isSupported | property |
isSupported:Boolean
[read-only] Whether the current device supports the extensions functionality
public static function get isSupported():Boolean
nativeVersion | property |
nativeVersion:String
[read-only]
The native version string of the native extension.
public function get nativeVersion():String
remoteCommandCenter | property |
remoteCommandCenter:RemoteCommandCenter
[read-only] Access to the remote command center functionality
public function get remoteCommandCenter():RemoteCommandCenter
service | property |
service:MediaPlayer
[read-only] The singleton instance of the MediaPlayer class.
public static function get service():MediaPlayer
Error — If there was a problem creating or accessing the extension, or if the developer key is invalid
|
soundPool | property |
soundPool:SoundPool
[read-only] Access the sound pool to playback sound effects
public function get soundPool():SoundPool
systemControl | property |
systemControl:SystemControl
[read-only]
public function get systemControl():SystemControl
utils | property |
utils:MediaUtils
[read-only]
Access to the media utilies
public function get utils():MediaUtils
version | property |
version:String
[read-only]
The version of this extension.
This should be of the format, MAJOR.MINOR.BUILD
public function get version():String
MediaPlayer | () | Constructor |
public function MediaPlayer()
Constructor You should not call this directly, but instead use the singleton access
addEventListener | () | method |
override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Parameters
type:String | |
listener:Function | |
useCapture:Boolean (default = false )
| |
priority:int (default = 0 )
| |
useWeakReference:Boolean (default = false )
|
createAudioPlayer | () | method |
public function createAudioPlayer(options:AudioPlayerOptions = null):AudioPlayer
Create an instance of an AudioPlayer using the specified options. The player can be used to load and playback audio files.
Parameters
options:AudioPlayerOptions (default = null ) — Options for the audio player or null to use the default options
|
AudioPlayer — An AudioPlayer instance for audio playback
|
createPlayerView | () | method |
public function createPlayerView(options:MediaPlayerOptions = null):MediaPlayerView
Create an instance of a MediaPlayerView using the specified options. The player can be used to show video files in a view.
Parameters
options:MediaPlayerOptions (default = null ) — Options for the media player view or null to use the default options
|
MediaPlayerView — A MediaPlayerView view instance for video playback
|
dispose | () | method |
public function dispose():void
Disposes the extension and releases any allocated resources. Once this function
has been called, a call to init
is neccesary again before any of the
extensions functionality will work.
init | () | method |
public static function init(key:String):void
Initialises the extension class for use with the provided key.
Parameters
key:String |
Error — If there was a problem creating or accessing the extension, or if the key is invalid
|
removeEventListener | () | method |
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Parameters
type:String | |
listener:Function | |
useCapture:Boolean (default = false )
|
CONTROLS_BASIC | Constant |
public static const CONTROLS_BASIC:String = controls:basic
Basic controls are displayed. The controls include a start/pause button and a scrubber bar.
Android only: on iOS this displays the same as CONTROLS_EMBEDDED
See also
CONTROLS_EMBEDDED | Constant |
public static const CONTROLS_EMBEDDED:String = controls:embedded
Controls for an embedded view are displayed. The controls include a start/pause button, a scrubber bar, and a button for toggling between fullscreen and embedded display modes.
CONTROLS_FULLSCREEN | Constant |
public static const CONTROLS_FULLSCREEN:String = controls:fullscreen
Controls for fullscreen playback are displayed. The controls include a start/pause button, a scrubber bar, forward and reverse seeking buttons, a button for toggling between fullscreen and embedded display modes, a button for toggling the aspect fill mode, and a Done button. Tapping the done button pauses the video and exits fullscreen mode.
CONTROLS_NONE | Constant |
public static const CONTROLS_NONE:String = controls:none
No controls are displayed.
EXT_CONTEXT_ID | Constant |
public static const EXT_CONTEXT_ID:String = com.distriqt.MediaPlayer
VERSION | Constant |
public static const VERSION:String = 5.0.0