com.samsung.multiscreen

## Class AudioPlayer

- java.lang.Object
- - com.samsung.multiscreen.Player
  - - com.samsung.multiscreen.AudioPlayer

-     public class AudioPlayer
      extends Player

  The `AudioPlayer` class allows control Audio Player on TV side. It extends Player class and defines audio player functionality.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `AudioPlayer.OnAudioPlayerListener` Public Listener Interface for Audio Player Notice events

    - ### Nested classes/interfaces inherited from class com.samsung.multiscreen.Player

      `Player.RepeatMode`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addOnMessageListener(AudioPlayer.OnAudioPlayerListener listener)` Add a listener for messages of audio player.
    `void` | `addToList(List<Map<String,String>> audioList)` public API to add content to list.
    `void` | `addToList(Uri ContentUrl)` public API to add content to list.
    `void` | `addToList(Uri ContentUrl, String title, String albumName, Uri albumArt)` public API to add content to list.
    `void` | `clearList()` public API to delete whole list.
    `void` | `getList()` public API to fetch the list.
    `void` | `playContent(Uri contentUrl, Result<Boolean> result)` public API to play audio content
    `void` | `playContent(Uri contentUrl, String title, String albumName, Uri albumArtUrl, Result<Boolean> result)` public API to play audio content
    `void` | `removeFromList(Uri uri)` public API to delete content from list.
    `void` | `repeat()` toggles repeat mode on/off
    `void` | `seekTo(int time, TimeUnit timeUnit)` seeks audio to specified time position.
    `void` | `setRepeat(Player.RepeatMode mode)` sets repeat mode to ON or OFF
    `void` | `setShuffle(boolean mode)` sets shuffle mode to ON (true) or OFF (false)
    `void` | `shuffle()` toggles shuffle mode on/off

    - ### Methods inherited from class com.samsung.multiscreen.Player

      `disconnect, disconnect, disconnect, getControlStatus, isConnected, isDebug, mute, next, pause, play, previous, removePlayerWatermark, resumeApplicationInForeground, setDebug, setOnClientConnectListener, setOnClientDisconnectListener, setOnConnectListener, setOnDisconnectListener, setOnErrorListener, setOnReadyListener, setPlayerWatermark, setVolume, standbyConnect, standbyConnect, standbyConnect, standbyConnect, stop, unMute, volumeDown, volumeUp`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### playContent

          public void playContent(Uri contentUrl,
                                  Result<Boolean> result)

      public API to play audio content
      Parameters:
        `contentUrl` - uri of the audio to be played
        `result` - callback

    - #### playContent

          public void playContent(Uri contentUrl,
                                  String title,
                                  String albumName,
                                  Uri albumArtUrl,
                                  Result<Boolean> result)

      public API to play audio content
      Parameters:
        `contentUrl` - uri of the audio to be played
        `title` - title of the audio
        `albumName` - album name
        `albumArtUrl` - album art url
        `result` - callback

    - #### seekTo

          public void seekTo(int time,
                             TimeUnit timeUnit)

      seeks audio to specified time position.
      Parameters:
        `time` - the offset in specified time units from the start to seek to
        `timeUnit` - unit of time in which time is specified.

    - #### repeat

          public void repeat()

      toggles repeat mode on/off

    - #### setRepeat

          public void setRepeat(Player.RepeatMode mode)

      sets repeat mode to ON or OFF
      Parameters:
        `mode` - repeatOff : repeat OFF repeatSingle : repeat Single repeatAll : repeat All

    - #### shuffle

          public void shuffle()

      toggles shuffle mode on/off

    - #### setShuffle

          public void setShuffle(boolean mode)

      sets shuffle mode to ON (true) or OFF (false)
      Parameters:
        `mode` - true - shuffle ON and vice-versa.

    - #### getList

          public void getList()

      public API to fetch the list.

    - #### clearList

          public void clearList()

      public API to delete whole list.

    - #### removeFromList

          public void removeFromList(Uri uri)

      public API to delete content from list.
      Parameters:
        `uri` - the uri of the content

    - #### addToList

          public void addToList(Uri ContentUrl)

      public API to add content to list.
      Parameters:
        `ContentUrl` - the uri of the content

    - #### addToList

          public void addToList(Uri ContentUrl,
                                String title,
                                String albumName,
                                Uri albumArt)

      public API to add content to list.
      Parameters:
        `ContentUrl` - uri of the content
        `title` - title of the content
        `albumName` - albumName of the content
        `albumArt` - albumArt image url related to the content

    - #### addToList

          public void addToList(List<Map<String,String>> audioList)

      public API to add content to list.
      Parameters:
        `audioList` - List of Maps of audio lists.

    - #### addOnMessageListener

          public void addOnMessageListener(AudioPlayer.OnAudioPlayerListener listener)

      Add a listener for messages of audio player.
      Parameters:
        `listener` - the message listener to invoke when a message is received with the specified event