Class NativePlayerVideoExperience
-
- All Implemented Interfaces:
public final class NativePlayerVideoExperienceManages 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.
-
-
Constructor Summary
Constructors Constructor Description NativePlayerVideoExperience(RelativeLayout parentView, CoroutineScope coroutineScope, MediaPlayer mediaPlayer, VideoPlayerConfig config, MutableSharedFlow<VideoEvent> mediaPlayerFlow)
-
Method Summary
Modifier and Type Method Description final JobinflateExperience()Initializes the video player experience, including Mute, UnMute, and progress bar. final JobonVideoResume()Called when the video resumes, that would turn up the volume and request audio focus. final JobonVideoPause()Called when the video pauses or stops, that would turn down the volume and remove audio focus. final Unitdestroy()Removes all the views and releases the audio focus. -
-
Constructor Detail
-
NativePlayerVideoExperience
NativePlayerVideoExperience(RelativeLayout parentView, CoroutineScope coroutineScope, MediaPlayer mediaPlayer, VideoPlayerConfig config, MutableSharedFlow<VideoEvent> mediaPlayerFlow)
-
-
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.
-
-
-
-