public class MediaManager
extends java.lang.Object
MediaPlayer
,
MediaRecorder
Modifier | Constructor and Description |
---|---|
private |
MediaManager() |
Modifier and Type | Method and Description |
---|---|
static void |
addMediaErrorListener(MediaErrorListener listener)
Add a global listener for warnings.
|
static boolean |
canPlayContentType(java.lang.String contentType)
Whether a media source having the indicated content type may be
played.
|
static boolean |
canPlayProtocol(java.lang.String protocol)
Whether a media source having the indicated protocol may be
played.
|
static java.util.List<MediaPlayer> |
getAllMediaPlayers()
Retrieve all un-disposed
MediaPlayer s. |
static Media |
getMedia(Locator locator)
Gets a Media object for the clip.
|
static MetadataParser |
getMetadataParser(Locator locator) |
static MediaPlayer |
getPlayer(Locator locator)
Get a player for the media locator
|
static java.lang.String[] |
getSupportedContentTypes() |
static void |
registerMediaPlayerForDispose(java.lang.Object obj,
MediaPlayer player)
This function will register MediaPlayer for disposing when obj parameter
does not have any strong reference.
|
static void |
removeMediaErrorListener(MediaErrorListener listener)
Remove a global listener for warnings.
|
public static java.lang.String[] getSupportedContentTypes()
String
array of supported content types.public static boolean canPlayContentType(java.lang.String contentType)
java.lang.IllegalArgumentException
- if contentType
is
null
.public static boolean canPlayProtocol(java.lang.String protocol)
java.lang.IllegalArgumentException
- if contentType
is
null
.public static MetadataParser getMetadataParser(Locator locator)
public static Media getMedia(Locator locator)
locator
- java.lang.IllegalArgumentException
- if locator
is
null
.public static MediaPlayer getPlayer(Locator locator)
locator
- java.lang.IllegalArgumentException
- if locator
is
null
.public static void addMediaErrorListener(MediaErrorListener listener)
listener
- The listener to add.java.lang.IllegalArgumentException
- if listener
is
null
.public static void removeMediaErrorListener(MediaErrorListener listener)
listener
- The listener to remove.java.lang.IllegalArgumentException
- if listener
is
null
.public static void registerMediaPlayerForDispose(java.lang.Object obj, MediaPlayer player)
obj
- - Object to watch for strong referencesplayer
- - MediaPlayer to disposepublic static java.util.List<MediaPlayer> getAllMediaPlayers()
MediaPlayer
s.List
of all un-disposed players or null
.