Interface AudioPlayer

  • All Implemented Interfaces:

    
    public interface AudioPlayer
    
                        

    Audio player used to play audio messages.

    • Constructor Detail

    • Method Detail

      • onProgressStateChange

         abstract Unit onProgressStateChange(Integer hash, Function1<ProgressData, Unit> func)

        Subscribing for progress changes for the audio of the hash. The progress is updated every 50ms

        Parameters:
        hash - the identifier of the audio track
        func - The listener of the ProgressData change.
      • onSpeedChange

         abstract Unit onSpeedChange(Integer hash, Function1<Float, Unit> func)

        Subscribing for speed changes for the audio of the hash.

        Parameters:
        hash - the identifier of the audio track
        func - The listener of the speed change.
      • play

         abstract Unit play(String sourceUrl, Integer audioHash)

        Plays an audio track with sourceUrl.

        Parameters:
        sourceUrl - the URL of the audio track
      • pause

         abstract Unit pause()

        Pauses the current song.

      • seekTo

         abstract Unit seekTo(Integer msec, Integer hash)

        Seeks the audio track of the audio hash to the milli second position. If the hash is the same of the current playing audio track, the current audio track pauses.

        Parameters:
        msec - the position in milli seconds.
        hash - the identifier of the audio track
      • startSeek

         abstract Unit startSeek(Integer audioHash)

        Informs the player that seek has started. This can be used to pause the current audio track when seek starts.

      • changeSpeed

         abstract Unit changeSpeed()

        Changes the speed of reproduction. Options are 1x, 1.5x and 2x

      • currentSpeed

         abstract Float currentSpeed()

        Current speed of reproduction. Options are 1x, 1.5x and 2x

      • removeAudio

         abstract Unit removeAudio(Integer audioHash)

        Removes the current audio form the reproduction queue and removes the listeners

      • removeAudios

         abstract Unit removeAudios(List<Integer> audioHashList)

        Removes the current audios form the reproduction queue and removes the listeners

      • dispose

         abstract Unit dispose()

        Disposes the MediaPlayer and remove all audios.