public class MediaManager extends Object
Constructor and Description |
---|
MediaManager() |
Modifier and Type | Method and Description |
---|---|
static Media |
createMedia(InputStream stream,
String mimeType)
Creates the Media in the given stream
Notice that a Media is "auto destroyed" on completion and cannot be played
twice!
|
static Media |
createMedia(InputStream stream,
String mimeType,
Runnable onCompletion)
Creates the Media in the given stream
Notice that a Media is "auto destroyed" on completion and cannot be played
twice!
|
static Media |
createMedia(String uri,
boolean isVideo)
Creates a Media from a given URI
|
static Media |
createMedia(String uri,
boolean isVideo,
Runnable onCompletion)
Creates a Media from a given URI
|
static Media |
createMediaRecorder(String path)
Deprecated.
see createMediaRecorder(String path, String mimeType) instead
|
static Media |
createMediaRecorder(String path,
String mimeType)
Creates a Media recorder Object which will record from the device mic to
a file in the given path.
|
static String[] |
getAvailableRecordingMimeTypes()
Gets the available recording MimeTypes
|
static String |
getMediaRecorderingMimeType()
Deprecated.
see getAvailableRecordingMimeTypes() instead
|
public static Media createMedia(String uri, boolean isVideo) throws IOException
uri
- the uri of the media can start with file://, http:// (can also
use rtsp:// although may not be supported on all target platforms)isVideo
- a boolean flag to indicate if this is a video mediaIOException
- if creation of media from the given URI has failedpublic static Media createMedia(InputStream stream, String mimeType) throws IOException
stream
- the stream containing the media datamimeType
- the type of the data in the streamIOException
- if the creation of the Media has failedpublic static Media createMedia(String uri, boolean isVideo, Runnable onCompletion) throws IOException
uri
- the uri of the media can start with file://, http:// (can also
use rtsp:// although may not be supported on all target platforms)isVideo
- a boolean flag to indicate if this is a video mediaonCompletion
- a Runnable to be called when the media has finishedIOException
- if creation of media from given URI failedpublic static Media createMedia(InputStream stream, String mimeType, Runnable onCompletion) throws IOException
stream
- the stream containing the media datamimeType
- the type of the data in the streamonCompletion
- a Runnable to be called when the media has finishedIOException
- if the URI access failspublic static Media createMediaRecorder(String path) throws IOException
path
- a file path to where to store the recording, if the file does
not exists it will be created.IOException
public static String getMediaRecorderingMimeType()
public static String[] getAvailableRecordingMimeTypes()
public static Media createMediaRecorder(String path, String mimeType) throws IOException
path
- a file path to where to store the recording, if the file does
not exists it will be created.mimeType
- the output mime type that is supported see
getAvailableRecordingMimeTypes()IllegalArgumentException
- if given mime-type is not supportedIOException
- id failed to create a Media object