public interface Media
MediaManager
Modifier and Type | Field and Description |
---|---|
static String |
VARIABLE_BACKGROUND_ALBUM_COVER
Write only variable that can be used with setVariable to pass the album cover Image to the
native layer so the currently playing media title will be displayed in the lock screen
where applicable
|
static String |
VARIABLE_BACKGROUND_ARTIST
Write only variable that can be used with setVariable to pass the artist name to the
native layer so the currently playing media title will be displayed in the lock screen
where applicable
|
static String |
VARIABLE_BACKGROUND_DURATION
Write only variable that can be used with setVariable to pass the duration for the media as a Long object to the
native layer so the currently playing media title will be displayed in the lock screen
where applicable
|
static String |
VARIABLE_BACKGROUND_POSITION
Write only variable that can be used with setVariable to pass the position in the media (Long object) to the
native layer so the currently playing media title will be displayed in the lock screen
where applicable
|
static String |
VARIABLE_BACKGROUND_SUPPORTED
Read only variable that can be used with getVariable to query whether the
native layer supports displaying the currently playing media information
in the lock screen.
|
static String |
VARIABLE_BACKGROUND_TITLE
Write only variable that can be used with setVariable to pass a title for the
native layer so the currently playing media title will be displayed in the lock screen
where applicable
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Stops the audio playback and cleans up the resources related to it immediately.
|
int |
getDuration()
Returns the length in seconds of the audio file or -1 if not known
|
int |
getTime()
Returns the time in seconds in the audio file or -1 if not known
|
Object |
getVariable(String key)
Allows querying platform specific information from the media object
|
Component |
getVideoComponent()
Gets the VideoComponent of this Video.
|
int |
getVolume()
Returns the media playback volume in percentage
|
boolean |
isFullScreen()
This method returns true if this video is in full screen mode.
|
boolean |
isNativePlayerMode()
Returns true if this Video Media is in Native player mode.
|
boolean |
isPlaying()
Returns true if the media is currently playing
|
boolean |
isVideo()
This method returns true if this is a Video Media
|
void |
pause()
Pauses the playback of the audio file
|
void |
play()
Starts playing the audio file
|
void |
prepare()
Optional call that allows the caller to prepare the upcoming media player.
|
void |
setFullScreen(boolean fullScreen)
Sets the Media to be displayed full screen, make sure the
getVideoComponent() is called on the Video Component is added to the
current Form
|
void |
setNativePlayerMode(boolean nativePlayer)
By calling this the Media (if it's a Video) will be played full screen
on the native Player of the device.
|
void |
setTime(int time)
Sets the position in the audio file or doesn't effect if not supported
|
void |
setVariable(String key,
Object value)
Allows for platform specific enhancements for media playback
|
void |
setVolume(int vol)
Sets the media playback volume in percentage
|
static final String VARIABLE_BACKGROUND_TITLE
static final String VARIABLE_BACKGROUND_ARTIST
static final String VARIABLE_BACKGROUND_DURATION
static final String VARIABLE_BACKGROUND_ALBUM_COVER
static final String VARIABLE_BACKGROUND_POSITION
static final String VARIABLE_BACKGROUND_SUPPORTED
void play()
void pause()
void prepare()
void cleanup()
int getTime()
void setTime(int time)
time
- in milli secondsint getDuration()
void setVolume(int vol)
vol
- the volume for media playbackint getVolume()
boolean isPlaying()
Component getVideoComponent()
boolean isVideo()
boolean isFullScreen()
void setFullScreen(boolean fullScreen)
fullScreen
- void setNativePlayerMode(boolean nativePlayer)
boolean isNativePlayerMode()
void setVariable(String key, Object value)
key
- the key to set to the media that is platform specificvalue
- the value