Class DeferredComponentIdVideoSurface

java.lang.Object
uk.co.caprica.vlcj.player.embedded.videosurface.VideoSurface
uk.co.caprica.vlcj.player.embedded.videosurface.DeferredComponentIdVideoSurface

public abstract class DeferredComponentIdVideoSurface extends VideoSurface
Encapsulation of a video surface that wraps the native component id of the video surface component - the component id is obtained when needed via a template method.

This is required for example when using remote out-of-process media players but with video rendering in a local application. In these scenarios, it is not possible to serialize the Canvas component to the remote process to get the proper component ID (the copied Canvas component would have a different native ID).

It is also not possible to get a native component ID if the component is not displayable.

  • Constructor Details

    • DeferredComponentIdVideoSurface

      public DeferredComponentIdVideoSurface(VideoSurfaceAdapter videoSurfaceAdapter)
      Create a new video surface.
      Parameters:
      videoSurfaceAdapter - adapter to attach a video surface to a native media player
  • Method Details

    • attach

      public void attach(MediaPlayer mediaPlayer)
      Description copied from class: VideoSurface
      Attach the video surface to a media player.

      The video surface component must be visible at this point otherwise the native call will fail.

      Specified by:
      attach in class VideoSurface
      Parameters:
      mediaPlayer - media player instance