Class ExperienceUtilsKt
-
- All Implemented Interfaces:
public final class ExperienceUtilsKt
-
-
Method Summary
Modifier and Type Method Description final static UnitturnUpVolume(MediaPlayer $self)Turns up the volume of the MediaPlayer to maximum level. final static UnitturnDownVolume(MediaPlayer $self)Turns down the volume of the MediaPlayer to minimum level (mute). final static UnitseekMediaPlayerToStart(MediaPlayer $self)Seeks the MediaPlayer to the start position (0). final static UnitstartMediaPlayer(MediaPlayer $self)Starts playback on the MediaPlayer. final static UnitpauseMediaPlayer(MediaPlayer $self)Pauses playback on the MediaPlayer. final static UnitsetMediaPlayerSurface(MediaPlayer $self, Surface surface)Sets the surface for video rendering on the MediaPlayer. final static BooleanisPlayerPlaying(MediaPlayer $self)Checks if the MediaPlayer is currently playing. final static UnitapplyMuteParams(CustomView $self, AudioConfig audioConfig, Float density)Applies mute button parameters to a CustomView based on audio configuration. final static UnitapplyProgressParams(ProgressBar $self, ProgressConfig progressConfig, Float density)Applies progress bar parameters to a ProgressBar based on progress configuration. -
-
Method Detail
-
turnUpVolume
final static Unit turnUpVolume(MediaPlayer $self)
Turns up the volume of the MediaPlayer to maximum level.
This function safely sets the MediaPlayer volume to full (1.0f) for both left and right audio channels, catching any IllegalStateException that might occur if the player is in an invalid state.
-
turnDownVolume
final static Unit turnDownVolume(MediaPlayer $self)
Turns down the volume of the MediaPlayer to minimum level (mute).
This function safely sets the MediaPlayer volume to zero for both left and right audio channels, effectively muting the player while catching any IllegalStateException that might occur.
-
seekMediaPlayerToStart
final static Unit seekMediaPlayerToStart(MediaPlayer $self)
Seeks the MediaPlayer to the start position (0).
This function safely resets the playback position to the beginning of the media, catching any IllegalStateException that might occur if the player is in an invalid state.
-
startMediaPlayer
final static Unit startMediaPlayer(MediaPlayer $self)
Starts playback on the MediaPlayer.
This function safely starts media playback, catching any IllegalStateException that might occur if the player is not in a valid state for starting playback.
-
pauseMediaPlayer
final static Unit pauseMediaPlayer(MediaPlayer $self)
Pauses playback on the MediaPlayer.
This function safely pauses media playback, catching any IllegalStateException that might occur if the player is not in a valid state for pausing.
-
setMediaPlayerSurface
final static Unit setMediaPlayerSurface(MediaPlayer $self, Surface surface)
Sets the surface for video rendering on the MediaPlayer.
This function safely attaches a surface to the MediaPlayer for video output, catching any IllegalStateException that might occur during the surface attachment process.
- Parameters:
surface- The Surface to attach for video rendering, or null to detach
-
isPlayerPlaying
final static Boolean isPlayerPlaying(MediaPlayer $self)
Checks if the MediaPlayer is currently playing.
This function safely queries the MediaPlayer's playing state, returning false if an IllegalStateException occurs, indicating the player is not in a valid state.
- Returns:
true if the player is currently playing, false otherwise
-
applyMuteParams
final static Unit applyMuteParams(CustomView $self, AudioConfig audioConfig, Float density)
Applies mute button parameters to a CustomView based on audio configuration.
This function configures the layout parameters, position, and margins for mute/unmute buttons in the video player experience.
- Parameters:
audioConfig- The AudioConfig containing mute button settingsdensity- The screen density for converting dp to pixels
-
applyProgressParams
final static Unit applyProgressParams(ProgressBar $self, ProgressConfig progressConfig, Float density)
Applies progress bar parameters to a ProgressBar based on progress configuration.
This function configures the appearance, colors, and layout parameters for the video progress bar, handling different Android API levels for color tinting.
- Parameters:
progressConfig- The ProgressConfig containing progress bar settingsdensity- The screen density for converting dp to pixels
-
-
-
-