Class ComponentIdVideoSurface


  • public class ComponentIdVideoSurface
    extends VideoSurface
    Encapsulation of a video surface that wraps the native component id of the video surface component.

    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 Detail

      • ComponentIdVideoSurface

        public ComponentIdVideoSurface​(long componentId,
                                       VideoSurfaceAdapter videoSurfaceAdapter)
        Create a new video surface.
        Parameters:
        componentId - native component identifier for the video surface
        videoSurfaceAdapter - adapter to attach a video surface to a native media player
    • Method Detail

      • 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