| Package | Description |
|---|---|
| com.codename1.components |
Generic elaborate components that make use of both UI elements and storage.
|
| com.codename1.impl |
The implementation package should not be used by developers, it is an internal implementation detail
which will break compatibility between major Codename One releases.
|
| com.codename1.media |
Video and Audio playback support are handled within this package using the
Media & MediaManager APIs. |
| com.codename1.ui |
Main widget package containing the component/container "composite" similar
both in terminology and design to Swing/AWT.
|
| Modifier and Type | Method and Description |
|---|---|
Media |
MediaPlayer.getMedia()
Returns the Media Object of this MediaPlayer
|
| Constructor and Description |
|---|
MediaPlayer(Media video)
Empty constructor
|
| Modifier and Type | Method and Description |
|---|---|
Media |
CodenameOneImplementation.createBackgroundMedia(String uri)
Creates an audio media that can be played in the background.
|
Media |
CodenameOneImplementation.createMedia(InputStream stream,
String mimeType,
Runnable onCompletion)
Plays the sound in the given stream
|
Media |
CodenameOneImplementation.createMedia(String uri,
boolean isVideo,
Runnable onCompletion)
Plays the sound in the given URI which is partially platform specific.
|
Media |
CodenameOneImplementation.createMediaRecorder(MediaRecorderBuilder builder)
Creates a Media recorder Object which will record from the device mic to
a file in the given path.
|
Media |
CodenameOneImplementation.createMediaRecorder(String path,
String mimeType)
Creates a Media recorder Object which will record from the device mic to
a file in the given path.
|
| Modifier and Type | Method and Description |
|---|---|
AsyncResource<Media> |
CodenameOneImplementation.createBackgroundMediaAsync(String uri)
Creates an audio media that can be played in the background.
|
AsyncResource<Media> |
CodenameOneImplementation.createMediaAsync(InputStream stream,
String mimeType,
Runnable onCompletion)
Creates media asynchronously.
|
AsyncResource<Media> |
CodenameOneImplementation.createMediaAsync(String uri,
boolean video,
Runnable onCompletion)
Creates media asynchronously.
|
| Modifier and Type | Method and Description |
|---|---|
void |
CodenameOneImplementation.addCompletionHandler(Media media,
Runnable onCompletion)
Adds a callback to a Media element that will be called when the media finishes playing.
|
void |
CodenameOneImplementation.removeCompletionHandler(Media media,
Runnable onCompletion)
Removes onComplete callback from Media element.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
AsyncMedia
An interface for media elements that provides asynchronous pause and play functionality
as well as support for state change events, so that interested parties can register
to be notified when state changes between play and pause.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractMedia
An abstract base class for AsyncMedia.
|
| Modifier and Type | Method and Description |
|---|---|
Media |
MediaRecorderBuilder.build()
Builds the MediaRecorder with the given settings.
|
static Media |
MediaManager.createBackgroundMedia(String uri)
Creates an audio media that can be played in the background.
|
static Media |
MediaManager.createMedia(InputStream stream,
String mimeType)
Creates the Media in the given stream.
|
static Media |
MediaManager.createMedia(InputStream stream,
String mimeType,
Runnable onCompletion)
Creates the Media in the given stream
Notice that you should invoke cleanup on a media once you are done with it.
|
static Media |
MediaManager.createMedia(String uri,
boolean isVideo)
Creates a Media from a given URI
|
static Media |
MediaManager.createMedia(String uri,
boolean isVideo,
Runnable onCompletion)
Creates a Media from a given URI
|
static Media |
MediaManager.createMediaRecorder(MediaRecorderBuilder builder)
Creates a Media recorder Object which will record from the device mic to
a file in the given path.
|
static Media |
MediaManager.createMediaRecorder(String path)
Deprecated.
see createMediaRecorder(String path, String mimeType) instead
|
static Media |
MediaManager.createMediaRecorder(String path,
String mimeType)
Creates a Media recorder Object which will record from the device mic to
a file in the given path.
|
| Modifier and Type | Method and Description |
|---|---|
static AsyncResource<Media> |
MediaManager.createBackgroundMediaAsync(String uri)
Creates an audio media asynchronously that can be played in the background.
|
static AsyncResource<Media> |
MediaManager.createMediaAsync(InputStream stream,
String mimeType,
Runnable onCompletion)
Creates the Media in the given stream asynchronously.
|
static AsyncResource<Media> |
MediaManager.createMediaAsync(String uri,
boolean isVideo,
Runnable onCompletion)
Creates a Media from a given URI asynchronously.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
MediaManager.addCompletionHandler(Media media,
Runnable onCompletion)
Adds a callback to a Media element that will be called when the media finishes playing.
|
static AsyncMedia |
MediaManager.getAsyncMedia(Media media)
Converts the media object into an AsyncMedia object.
|
static void |
MediaManager.removeCompletionHandler(Media media,
Runnable onCompletion)
Removes onComplete callback from Media element.
|
| Constructor and Description |
|---|
MediaErrorEvent(Media source,
AsyncMedia.MediaException error)
Creates a new error event with the given exception.
|
| Modifier and Type | Method and Description |
|---|---|
Media |
Display.createBackgroundMedia(String uri)
Creates an audio media that can be played in the background.
|
Media |
Display.createMedia(InputStream stream,
String mimeType,
Runnable onCompletion)
Create the sound in the given stream
Notice that an audio is "auto destroyed" on completion and cannot be played
twice!
|
Media |
Display.createMedia(String uri,
boolean isVideo,
Runnable onCompletion)
Creates a sound in the given URI which is partially platform specific.
|
Media |
Display.createMediaRecorder(MediaRecorderBuilder builder)
Deprecated.
use MediaRecorderBuilder#build()
|
Media |
Display.createMediaRecorder(String path)
Deprecated.
|
Media |
Display.createMediaRecorder(String path,
String mimeType)
Creates a Media recorder Object which will record from the device mic to
a file in the given path.
|
| Modifier and Type | Method and Description |
|---|---|
AsyncResource<Media> |
Display.createBackgroundMediaAsync(String uri)
Creates an audio media that can be played in the background.
|
AsyncResource<Media> |
Display.createMediaAsync(InputStream stream,
String mimeType,
Runnable onCompletion) |
AsyncResource<Media> |
Display.createMediaAsync(String uri,
boolean video,
Runnable onCompletion)
Creates media asynchronously.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Display.addCompletionHandler(Media media,
Runnable onCompletion)
Adds a callback to a Media element that will be called when the media finishes playing.
|
void |
Display.removeCompletionHandler(Media media,
Runnable onCompletion)
Removes onComplete callback from Media element.
|
Copyright © 2023. All rights reserved.