Class HtmlPlayerTextureManager

    • Method Detail

      • destroy

         final Unit destroy()

        Destroys the texture view and releases resources. This method removes the surface texture listener.

      • onVideoSizeChanged

         final Unit onVideoSizeChanged(Integer width, Integer height)

        Attaches a listener to handle video size changes from the media player.

        This method sets up a callback to receive notifications when the video dimensions change, allowing the texture view to update its aspect ratio accordingly.

      • updateVideoAspectRatio

         final Unit updateVideoAspectRatio()

        Updates the video aspect ratio based on the current video dimensions.

      • attachTextureViewListener

         final Unit attachTextureViewListener()

        Attaches a surface texture listener to handle texture lifecycle events.

        This method sets up callbacks to receive notifications about surface texture availability, destruction, and other lifecycle events. It forwards these events to the provided SurfaceTextureListener.

      • inflate

         final Unit inflate(SurfaceTextureListener surfaceTextureListener)

        Inflates the texture view and adds it to the parent view.

        This method sets up the texture view, attaches listeners for video size changes and surface texture events, and updates the video aspect ratio.

        Parameters:
        surfaceTextureListener - The SurfaceTextureListener for receiving surface texture events.