Class HtmlPlayerTextureManager
-
- All Implemented Interfaces:
@MainThread() public final class HtmlPlayerTextureManager
-
-
Constructor Summary
Constructors Constructor Description HtmlPlayerTextureManager(CustomTextureView textureView, ViewGroup parentView, Player mediaPlayer, InMobiLogger logger)
-
Method Summary
Modifier and Type Method Description final UnitsetOnPositionChangeListener(OnPositionChangeListener listener)final Unitdestroy()Destroys the texture view and releases resources. final UnitonVideoSizeChanged(Integer width, Integer height)Attaches a listener to handle video size changes from the media player. final UnitupdateVideoAspectRatio()Updates the video aspect ratio based on the current video dimensions. final UnitattachTextureViewListener()Attaches a surface texture listener to handle texture lifecycle events. final Unitinflate(SurfaceTextureListener surfaceTextureListener)Inflates the texture view and adds it to the parent view. -
-
Constructor Detail
-
HtmlPlayerTextureManager
HtmlPlayerTextureManager(CustomTextureView textureView, ViewGroup parentView, Player mediaPlayer, InMobiLogger logger)
-
-
Method Detail
-
setOnPositionChangeListener
final Unit setOnPositionChangeListener(OnPositionChangeListener listener)
-
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.
-
-
-
-