Interface SurfaceViewabilityListener

  • All Implemented Interfaces:

    
    public interface SurfaceViewabilityListener
    
                        

    Interface for handling video surface viewability changes.

    This listener provides callbacks for viewability-related events that determine when video playback should start, pause, or when the surface becomes available. It is typically used in conjunction with viewability tracking to control video playback based on whether the video surface is visible to the user.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit playVideo() Called when the video should start playing.
      abstract Unit pauseVideo() Called when the video should be paused.
      abstract Unit onSurfaceTextureAvailable() Called when the surface texture becomes available for rendering.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • playVideo

         abstract Unit playVideo()

        Called when the video should start playing.

        This method is invoked when the video surface becomes viewable and meets the criteria for starting video playback, such as being sufficiently visible on screen according to viewability requirements.

      • pauseVideo

         abstract Unit pauseVideo()

        Called when the video should be paused.

        This method is invoked when the video surface becomes non-viewable or no longer meets the criteria for active playback, such as being scrolled out of view or obscured by other content.

      • onSurfaceTextureAvailable

         abstract Unit onSurfaceTextureAvailable()

        Called when the surface texture becomes available for rendering.

        This method is invoked when the underlying surface texture is ready to receive video frames, indicating that the video player can begin or resume rendering video content to the surface.