Class NativePlayerVideoExperience

  • All Implemented Interfaces:

    
    public final class NativePlayerVideoExperience
    
                        

    Manages the video player experience including audio controls, progress tracking, and UI elements.

    This class provides a comprehensive video experience by managing mute/unmute functionality, progress bar visualization, audio focus handling, and the overall user interface for video playback. It coordinates between the media player, audio focus manager, and various UI components to deliver a seamless video viewing experience.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Job inflateExperience() Initializes the video player experience, including Mute, UnMute, and progress bar.
      final Job onVideoResume() Called when the video resumes, that would turn up the volume and request audio focus.
      final Job onVideoPause() Called when the video pauses or stops, that would turn down the volume and remove audio focus.
      final Unit destroy() Removes all the views and releases the audio focus.
      • Methods inherited from class java.lang.Object

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

      • inflateExperience

         final Job inflateExperience()

        Initializes the video player experience, including Mute, UnMute, and progress bar.

        This method sets up the complete video experience UI by attaching the experience layout to the parent view, configuring initial mute state based on configuration, and adding the appropriate control buttons and progress indicators.

      • onVideoResume

         final Job onVideoResume()

        Called when the video resumes, that would turn up the volume and request audio focus.

        This method activates the experience layout for user interaction and manages audio state based on the current mute status, either muting the player or requesting audio focus and unmuting as appropriate.

      • onVideoPause

         final Job onVideoPause()

        Called when the video pauses or stops, that would turn down the volume and remove audio focus.

        This method deactivates the experience layout and ensures proper cleanup of audio resources by turning down the volume and abandoning audio focus to allow other apps to use audio.

      • destroy

         final Unit destroy()

        Removes all the views and releases the audio focus.

        This method performs cleanup by removing all child views from the experience layout and releasing audio focus manager resources to prevent memory leaks.