Interface SurfaceTextureListener
-
- All Implemented Interfaces:
public interface SurfaceTextureListenerInterface for handling surface texture lifecycle events in video playback.
This listener provides callbacks for key surface texture events that occur during video rendering, allowing the video player to respond to surface availability and destruction events.
-
-
Method Summary
Modifier and Type Method Description abstract UnitonSurfaceTextureAvailable(SurfaceTexture surface)Called when the surface texture becomes available for rendering. abstract UnitonSurfaceTextureDestroyed()Called when the surface texture is about to be destroyed. -
-
Method Detail
-
onSurfaceTextureAvailable
abstract Unit onSurfaceTextureAvailable(SurfaceTexture surface)
Called when the surface texture becomes available for rendering.
This method is invoked when the underlying surface is ready to receive video frames. The video player should attach the media player to this surface to start rendering video content.
- Parameters:
surface- The SurfaceTexture that is now available for video rendering
-
onSurfaceTextureDestroyed
abstract Unit onSurfaceTextureDestroyed()
Called when the surface texture is about to be destroyed.
This method is invoked when the surface is no longer available for rendering. The video player should detach the media player from the surface and clean up any resources associated with the surface to prevent memory leaks.
-
-
-
-