Class OverlayApi
- java.lang.Object
-
- uk.co.caprica.vlcj.player.embedded.OverlayApi
-
public final class OverlayApi extends Object
Behaviour pertaining to the heavyweight overlay.Overlay is only support if the video surface associated with the media player is a
ComponentVideoSurface
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enable(boolean enable)
Enable/disable the overlay component if there is one.boolean
enabled()
Check whether or not there is an overlay component currently enabled.Window
get()
Get the overlay component.void
set(Window overlay)
Set a new overlay component.
-
-
-
Method Detail
-
get
public Window get()
Get the overlay component.- Returns:
- overlay component, may be
null
-
set
public void set(Window overlay)
Set a new overlay component.The existing overlay if there is one will be disabled.
The new overlay will not automatically be enabled.
The overlay should be a sub-class of
Window
orJWindow
. If your overlay contains dynamically updated content such as a timer or animated graphics, then you should useJWindow
so that your updates will be double-buffered and there will be no tearing or flickering when you paint the overlay. If you do this, you must take care to erase the overlay background before you paint it.When the overlay is no longer needed it is your responsibility to
Window.dispose()
it - if you do not do this you may leak resources. If you set multiple different overlays you must remember to dispose the old overlay.It is recommended to set the overlay once as early as possible in your application.
- Parameters:
overlay
- overlay component, may benull
-
enable
public void enable(boolean enable)
Enable/disable the overlay component if there is one.- Parameters:
enable
- whether to enable the overlay or disable it
-
enabled
public boolean enabled()
Check whether or not there is an overlay component currently enabled.- Returns:
- true if there is an overlay enabled, otherwise false
-
-