# BasePlayer

    @objc open class BasePlayer: NSObject

Base class for audio, video and photo player

- `connectionDelegate`

  The Connection delegate protocol defines the event methods available for channel Connection/DisConnection.

  #### Declaration

  Swift

      open weak var connectionDelegate: ConnectionDelegate? = nil

### APIs for Common Use, Objective C + Swift

- `disconnect(_:completionHandler:)`

  Disconnects to the channel. This method will asynchronously call the delegate’s onDisconnect method and post a ChannelEvent. - parameter completionHandler: callback handler of OnDisconnect

  #### Declaration

  Swift

      @objc open func disconnect(_ leaveHostRunning: Bool = true, completionHandler: ((_ error: NSError?) -> Void)? = nil)

  #### Parameters

  `completionHandler` | callback handler of OnDisconnect

- `play()`

  Play last sent media contents.

  #### Declaration

  Swift

      @objc open func play()

- `pause()`

  Pause currently playing media.

  #### Declaration

  Swift

      @objc open func pause()

- `stop()`

  Stop currently playing media.

  #### Declaration

  Swift

      @objc open func stop()

- `mute()`

  Mute the volume of player on a connected device.

  #### Declaration

  Swift

      @objc open func mute()

- `unMute()`

  UnMute the volume of player on a connected device.

  #### Declaration

  Swift

      @objc open func unMute()

- `getVolume()`

  Request the volume of player on a connected device.

  #### Declaration

  Swift

      @objc open func getVolume()

- `previous()`

  Request previous to the player on a connected device.

  #### Declaration

  Swift

      @objc open func previous()

- `next()`

  Request next to the player on a connected device.

  #### Declaration

  Swift

      @objc open func next()

- `setVolume(_:)`

  Set volume on device playing media.

  #### Declaration

  Swift

      @objc open func setVolume(_ volume: UInt8)

  #### Parameters

  `volume` | Integer value between 0 and 100.

- `volumeUp()`

  increase volume of the player by 1.

  #### Declaration

  Swift

      @objc open func volumeUp()

- `volumeDown()`

  decrease volume of the player by 1.

  #### Declaration

  Swift

      @objc open func volumeDown()

- `getControlStatus()`

  get the control status of the player - like volume etc.

  #### Declaration

  Swift

      @objc open func getControlStatus()