- Direct Known Subclasses:
EmbeddedMediaPlayer
This can be used for those media players that do not require a video surface embedded into a user interface, for example audio-only players, or less likely media players that will use a native window created by LibVLC.
-
Constructor Summary
ConstructorsConstructorDescriptionMediaPlayer
(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t instance) Create a new media player.MediaPlayer
(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t instance, uk.co.caprica.vlcj.binding.internal.libvlc_media_player_t mediaPlayerInstance) Create a new media player. -
Method Summary
Modifier and TypeMethodDescriptionfinal AudioApi
audio()
final ChapterApi
chapters()
final ControlsApi
controls()
final EventApi
events()
final LogoApi
logo()
final MarqueeApi
marquee()
final MediaApi
media()
final uk.co.caprica.vlcj.binding.internal.libvlc_media_player_t
Provide access to the native media player instance.final MenuApi
menu()
final void
release()
Release the media player, freeing all associated (including native) resources.final RoleApi
role()
final boolean
setRenderer
(RendererItem rendererItem) Set an alternate media renderer.final SnapshotApi
final StatusApi
status()
final SubitemApi
subitems()
final void
Submit a task for asynchronous execution.final SubpictureApi
final TeletextApi
teletext()
final TitleApi
titles()
final Object
userData()
Get the user data associated with the media player.final void
Set user data to associate with the media player.final VideoApi
video()
-
Constructor Details
-
MediaPlayer
public MediaPlayer(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t instance) Create a new media player.- Parameters:
instance
- libvlc instance
-
MediaPlayer
public MediaPlayer(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t instance, uk.co.caprica.vlcj.binding.internal.libvlc_media_player_t mediaPlayerInstance) Create a new media player.This constructor for internal use only.
- Parameters:
instance
- libvlc instancemediaPlayerInstance
- native media player instance
-
-
Method Details
-
audio
-
chapters
-
controls
-
events
-
logo
-
marquee
-
media
-
role
-
snapshots
-
status
-
subitems
-
subpictures
-
teletext
-
titles
-
video
-
setRenderer
Set an alternate media renderer.If the supplied renderer item is not
null
this component will invokeRendererItem.hold()
.If a renderer was previously set, RendererItem
RendererItem.release()
will be invoked.A client application therefore need not, although it may, concern itself with hold/release.
If the new renderer could not be set it will be properly released (i.e. the hold acquired in this method will not be kept).
- Parameters:
rendererItem
- media renderer, ornull
to render as normal- Returns:
true
if successful;false
on error
-
userData
Get the user data associated with the media player.- Returns:
- user data
-
userData
Set user data to associate with the media player.- Parameters:
userData
- user data
-
submit
Submit a task for asynchronous execution.This is useful in particular for event handling code as native events are generated on a native event callback thread and it is not allowed to call back into LibVLC from this callback thread. If you do, either the call will be ineffective, strange behaviour will happen, or a fatal JVM crash may occur.
To mitigate this, those tasks can be offloaded from the native thread, serialised and executed using this method.
- Parameters:
r
- task to execute
-
release
public final void release()Release the media player, freeing all associated (including native) resources. -
mediaPlayerInstance
public final uk.co.caprica.vlcj.binding.internal.libvlc_media_player_t mediaPlayerInstance()Provide access to the native media player instance.This is exposed on the interface as an implementation side-effect, ordinary applications are not expected to use this.
- Returns:
- media player instance
-