Class ExperienceUtilsKt

    • Constructor Detail

    • 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 settings
        density - 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 settings
        density - The screen density for converting dp to pixels