Class CallbackMediaPlayerComponent

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
uk.co.caprica.vlcj.player.component.CallbackMediaPlayerComponent
All Implemented Interfaces:
KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, MediaEventListener, MediaPlayerEventListener, MediaPlayerComponent
Direct Known Subclasses:
CallbackMediaListPlayerComponentBase

public class CallbackMediaPlayerComponent extends JPanel implements MediaPlayerComponent
Implementation of a callback "direct-rendering" media player.

This component renders video frames received via native callbacks.

The component may be added directly to a user interface layout - this is optional, you can use this component without adding it directly to a user interface, in which case you would simply render the video however you like.

When the component is no longer needed, it should be released by invoking the release() method.

See Also:
  • Constructor Details

    • CallbackMediaPlayerComponent

      public CallbackMediaPlayerComponent(MediaPlayerFactory mediaPlayerFactory, FullScreenStrategy fullScreenStrategy, InputEvents inputEvents, boolean lockBuffers, CallbackImagePainter imagePainter, RenderCallback renderCallback, BufferFormatCallback bufferFormatCallback, JComponent videoSurfaceComponent)
      Construct a callback media player component.

      This component will provide a reasonable default implementation, but a client application is free to override these defaults with their own implementation.

      To rely on the defaults and have this component render the video, do not supply a renderCallback.

      If a client application wishes to perform its own rendering, provide a renderCallback, a BufferFormatCallback, and optionally (but likely) a videoSurfaceComponent if the client application wants the video surface they are rendering in to be incorporated into this component's layout.

      Parameters:
      mediaPlayerFactory - media player factory
      fullScreenStrategy - full screen strategy
      inputEvents - keyboard/mouse input event configuration
      lockBuffers - true if the native video buffer should be locked; false if not
      imagePainter - image painter (video renderer)
      renderCallback - render callback
      bufferFormatCallback - buffer format callback
      videoSurfaceComponent - lightweight video surface component
    • CallbackMediaPlayerComponent

      public CallbackMediaPlayerComponent(MediaPlayerFactory mediaPlayerFactory, FullScreenStrategy fullScreenStrategy, InputEvents inputEvents, boolean lockBuffers, CallbackImagePainter imagePainter)
      Construct a callback media list player component for intrinsic rendering (by this component).
      Parameters:
      mediaPlayerFactory - media player factory
      fullScreenStrategy - full screen strategy
      inputEvents - keyboard/mouse input event configuration
      lockBuffers - true if the native video buffer should be locked; false if not
      imagePainter - image painter (video renderer)
    • CallbackMediaPlayerComponent

      public CallbackMediaPlayerComponent(MediaPlayerFactory mediaPlayerFactory, FullScreenStrategy fullScreenStrategy, InputEvents inputEvents, boolean lockBuffers, RenderCallback renderCallback, BufferFormatCallback bufferFormatCallback, JComponent videoSurfaceComponent)
      Construct a callback media list player component for external rendering (by the client application).
      Parameters:
      mediaPlayerFactory - media player factory
      fullScreenStrategy - full screen strategy
      inputEvents - keyboard/mouse input event configuration
      lockBuffers - true if the native video buffer should be locked; false if not
      renderCallback - render callback
      bufferFormatCallback - buffer format callback
      videoSurfaceComponent - lightweight video surface component
    • CallbackMediaPlayerComponent

      public CallbackMediaPlayerComponent(MediaPlayerSpecs.CallbackMediaPlayerSpec spec)
      Create a callback media player component from a builder.
      Parameters:
      spec - builder
    • CallbackMediaPlayerComponent

      public CallbackMediaPlayerComponent(String... libvlcArgs)
      Create a callback media player component with LibVLC initialisation arguments and reasonable defaults.
      Parameters:
      libvlcArgs - LibVLC initialisation arguments
    • CallbackMediaPlayerComponent

      public CallbackMediaPlayerComponent()
      Create a callback media player component with reasonable defaults.
  • Method Details