Package | com.distriqt.extension.mediaplayer |
Class | public class MediaPlayerOptions |
Inheritance | MediaPlayerOptions ![]() |
Provides options controlling the settings of the media player.
Property | Defined By | ||
---|---|---|---|
autoPlay : Boolean = false
Whether the player should start playing the media as soon as the media is ready (default: false)
| MediaPlayerOptions | ||
backgroundAudioAllowed : Boolean = false
Enables background audio mode on the device. | MediaPlayerOptions | ||
backgroundColour : uint = 0xFF000000
The background colour of the player
| MediaPlayerOptions | ||
backgroundColourInt : int [read-only] | MediaPlayerOptions | ||
controls : String = controls:embedded Deprecated: Deprecated
The type of native controls to display. | MediaPlayerOptions | ||
controlsEnabled : Boolean = true
If true the player will display user controls to control playback. | MediaPlayerOptions | ||
remoteControlEventsEnabled : Boolean = false | MediaPlayerOptions | ||
resizeMode : String = fit | MediaPlayerOptions | ||
viewport : Rectangle
Set the initial viewport (or size) of the player in screen pixel coordinates. | MediaPlayerOptions | ||
viewportAutoScale : Boolean = false
When true the player position and size will be scaled appropriately. | MediaPlayerOptions |
Method | Defined By | ||
---|---|---|---|
MediaPlayerOptions(viewport:Rectangle = null)
Constructor
| MediaPlayerOptions | ||
enableBackgroundAudio(enabled:Boolean = true):MediaPlayerOptions | MediaPlayerOptions | ||
enableRemoteControlEvents(enabled:Boolean = true):MediaPlayerOptions | MediaPlayerOptions | ||
setAutoPlay(autoPlay:Boolean = true):MediaPlayerOptions
Sets whether the player should start playing the media as soon as the media is ready. | MediaPlayerOptions | ||
setBackgroundColour(colour:int):MediaPlayerOptions
Sets the background colour of the player. | MediaPlayerOptions | ||
setResizeMode(mode:String):MediaPlayerOptions
Sets the resize mode for the player. | MediaPlayerOptions | ||
setViewport(viewport:Rectangle):MediaPlayerOptions
Sets the initial viewport (or size) of the player in screen pixel coordinates. | MediaPlayerOptions | ||
showControls(enable:Boolean = true):MediaPlayerOptions
Sets whether the player controls should be shown to the user
| MediaPlayerOptions |
Constant | Defined By | ||
---|---|---|---|
CONTROLS_BASIC : String = controls:basic Deprecated: Deprecated [static]
Basic controls are displayed. | MediaPlayerOptions | ||
CONTROLS_EMBEDDED : String = controls:embedded Deprecated: Deprecated [static]
Controls for an embedded view are displayed. | MediaPlayerOptions | ||
CONTROLS_FULLSCREEN : String = controls:fullscreen Deprecated: Deprecated [static]
Controls for fullscreen playback are displayed. | MediaPlayerOptions | ||
CONTROLS_NONE : String = controls:none Deprecated: Deprecated [static]
No controls are displayed. | MediaPlayerOptions |
autoPlay | property |
public var autoPlay:Boolean = false
Whether the player should start playing the media as soon as the media is ready (default: false)
backgroundAudioAllowed | property |
public var backgroundAudioAllowed:Boolean = false
Enables background audio mode on the device. iOS Only Experimental Not yet fully supported
backgroundColour | property |
public var backgroundColour:uint = 0xFF000000
The background colour of the player
backgroundColourInt | property |
backgroundColourInt:int
[read-only] public function get backgroundColourInt():int
controls | property |
public var controls:String = controls:embedded
The type of native controls to display. See MediaPlayerOptions.CONTROLS_(default: CONTROLS_EMBEDDED)
controlsEnabled | property |
public var controlsEnabled:Boolean = true
If true
the player will display user controls to control playback.
remoteControlEventsEnabled | property |
public var remoteControlEventsEnabled:Boolean = false
resizeMode | property |
public var resizeMode:String = fit
viewport | property |
public var viewport:Rectangle
Set the initial viewport (or size) of the player in screen pixel coordinates. The x,y values indicate the position of the top left of the player and the width and height represent the width and height of the player window.
viewportAutoScale | property |
public var viewportAutoScale:Boolean = false
When true the player position and size will be scaled appropriately. This is useful when developing a non-retina supported application, all positions and sizes will be scaled to match the application. (default: false) This is an iOS only property
MediaPlayerOptions | () | Constructor |
public function MediaPlayerOptions(viewport:Rectangle = null)
Constructor
Parametersviewport:Rectangle (default = null )
|
enableBackgroundAudio | () | method |
public function enableBackgroundAudio(enabled:Boolean = true):MediaPlayerOptions
Parameters
enabled:Boolean (default = true )
|
MediaPlayerOptions |
enableRemoteControlEvents | () | method |
public function enableRemoteControlEvents(enabled:Boolean = true):MediaPlayerOptions
Parameters
enabled:Boolean (default = true )
|
MediaPlayerOptions |
setAutoPlay | () | method |
public function setAutoPlay(autoPlay:Boolean = true):MediaPlayerOptions
Sets whether the player should start playing the media as soon as the media is ready.
Parameters
autoPlay:Boolean (default = true ) — If true the player will start playing the media automatically.
|
MediaPlayerOptions — MediaPlayerOptions instance for method chaining.
|
setBackgroundColour | () | method |
public function setBackgroundColour(colour:int):MediaPlayerOptions
Sets the background colour of the player.
Parameters
colour:int — The background colour to use, in ARGB format.
|
MediaPlayerOptions — MediaPlayerOptions instance for method chaining.
|
setResizeMode | () | method |
public function setResizeMode(mode:String):MediaPlayerOptions
Sets the resize mode for the player.
Parameters
mode:String — The resize mode to use. One of the values defined in the ResizeMode class.
|
MediaPlayerOptions — MediaPlayerOptions instance for method chaining.
|
See also
setViewport | () | method |
public function setViewport(viewport:Rectangle):MediaPlayerOptions
Sets the initial viewport (or size) of the player in screen pixel coordinates. The x,y values indicate the position of the top left of the player and the width and height represent the width and height of the player window.
Parameters
viewport:Rectangle — The rectangle defining the viewport.
|
MediaPlayerOptions — MediaPlayerOptions instance for method chaining.
|
showControls | () | method |
public function showControls(enable:Boolean = true):MediaPlayerOptions
Sets whether the player controls should be shown to the user
Parameters
enable:Boolean (default = true ) — If true the player will display user controls to control playback.
|
MediaPlayerOptions — MediaPlayerOptions instance for method chaining.
|
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.