- 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 AudioApiaudio()final ChapterApichapters()final ControlsApicontrols()final EventApievents()final LogoApilogo()final MarqueeApimarquee()final MediaApimedia()final uk.co.caprica.vlcj.binding.internal.libvlc_media_player_tProvide access to the native media player instance.final MenuApimenu()final voidrelease()Release the media player, freeing all associated (including native) resources.final RoleApirole()final booleansetRenderer(RendererItem rendererItem) Set an alternate media renderer.final SnapshotApifinal StatusApistatus()final SubitemApisubitems()final voidSubmit a task for asynchronous execution.final SubpictureApifinal TeletextApiteletext()final TitleApititles()final ObjectuserData()Get the user data associated with the media player.final voidSet user data to associate with the media player.final VideoApivideo()
-
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
nullthis 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, ornullto render as normal- Returns:
trueif successful;falseon 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
-