# 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

- `standbyConnect(_:completionHandler:)`

  connects to the DMP standby screen with provides functionality to launch with Logo or upto three Background images - parameter screenSaverURL1: Optional Background Image Url

  #### Declaration

  Swift

      @objc open func standbyConnect(_ screenSaverURL1: URL? = nil, completionHandler: ((NSError?) -> Void)?)

  #### Parameters

  `screenSaverURL1` | Optional Background Image Url

- `standbyConnect(_:screenSaverURL2:completionHandler:)`

  connects to the DMP standby screen with provides functionality to launch with Logo or upto three Background images - parameter screenSaverURL1: Optional Background Image Url - parameter screenSaverURL2: Optional Background Image Url

  #### Declaration

  Swift

      @objc open func standbyConnect(_ screenSaverURL1: URL?, screenSaverURL2: URL?, completionHandler: ((NSError?) -> Void)?)

  #### Parameters

  `screenSaverURL1` | Optional Background Image Url
  `screenSaverURL2` | Optional Background Image Url

- `standbyConnect(_:screenSaverURL2:screenSaverURL3:completionHandler:)`

  connects to the DMP standby screen with provides functionality to launch with Logo or upto three Background images - parameter screenSaverURL1: Optional Background Image Url - parameter screenSaverURL2: Optional Background Image Url - parameter screenSaverURL3: Optional Background Image Url - parameter completionHandler: The response completion closure, it will be executed in the request queue i.e. in a backgound thread.

  #### Declaration

  Swift

      @objc open func standbyConnect(_ screenSaverURL1: URL?, screenSaverURL2: URL?, screenSaverURL3: URL?, completionHandler: ((NSError?) -> Void)?)

  #### Parameters

  `screenSaverURL1` | Optional Background Image Url
  `screenSaverURL2` | Optional Background Image Url
  `screenSaverURL3` | Optional Background Image Url
  `completionHandler` | The response completion closure, it will be executed in the request queue i.e. in a backgound thread.

- `setPlayerWatermark(_:)`

  Sets the Watermark for the player - parameter watermarkUrl: Url from where watermark image will be downloaded

  #### Declaration

  Swift

      @objc open func setPlayerWatermark(_ watermarkUrl: URL?)

  #### Parameters

  `watermarkUrl` | Url from where watermark image will be downloaded

- `removePlayerWatermark()`

  Removes Player watermark set

  #### Declaration

  Swift

      @objc open func removePlayerWatermark()

- `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()

- `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()

© 2017 . All rights reserved. (Last updated: 2017-06-08)

Generated by jazzy ♪♫ v0.7.4, a Realm project.