Module one.jpro.platform.media
Package one.jpro.platform.media
package one.jpro.platform.media
Provides the set of classes for integrating audio and video playback and recording into JavaFX applications
that run on desktop/mobile devices and also on the web via JPro server using exactly the same code.
This can be archived by using only the following classes: MediaSource,
MediaPlayer, MediaRecorder and
MediaView.
Supported media player MIME types
| Name | Value |
|---|---|
| AIFF | audio/x-aiff |
| MP3 | audio/mp3 |
| MPA | audio/mpeg |
| WAV | audio/x-wav |
| MP4 | video/mp4 |
| M4A | audio/x-m4a |
| M4V | video/x-m4v |
| M3U8 | application/vnd.apple.mpegurl |
| M3U | audio/mpegurl |
| MP2T | video/MP2T |
| FMP4 | video/quicktime |
| AAC | audio/aac |
Supported Protocols
| Protocol | Description | Reference |
|---|---|---|
| FILE | Protocol for URI representation of local files | java.net.URI |
| HTTP | Hypertext transfer protocol for representation of remote files | java.net.URI |
| HTTPS | Hypertext transfer protocol secure for representation of remote files | java.net.URI |
| JAR | Representation of media entries in files accessible via the FILE, HTTP or HTTPS protocols | java.net.JarURLConnection |
Error Handling
Errors using JPro Media are thrown immediately (synchronous), for example when aMediaPlayer is created by calling
MediaPlayer.create(javafx.stage.Stage, MediaSource)
or when MediaRecorder is created by calling
MediaRecorder.create(javafx.stage.Stage).
Also errors are thrown later asynchronously, for example during the playback and recording process.
These errors are reported by the MediaPlayer.onErrorProperty()
property by registering an error handler via
MediaPlayer.setOnError(javafx.event.EventHandler) or
MediaRecorder.setOnError(javafx.event.EventHandler).
After an error has accured, use MediaPlayer.getError() or
MediaRecorder.getError() to get the error message.
- Author:
- Besmir Beqiri
-
ClassDescriptionMedia engine interface is the root type for both
MediaPlayerandMediaRecorder.TheMediaSourceclass represents a media resource.Media engine interface for the web.MediaViewbase implementation for the web.