Adaptive Media Player

AmpChromecast Docs

AmpChromecastObserver

@objc public protocol AmpChromecastObserver

Protocol used to receive Chromecast events.

  • Callback called when a device has connected.

    Declaration

    Swift

    @objc optional func onChromecastDeviceConnected(_ manager: AmpChromecastManager, device: GCKDevice)

    Parameters

    ampChromecastManager

    The instance of the AMP Chromecast Manager that sends the event.

    device

    The device that triggered the event.

  • Callback called when a device has disconnected.

    Declaration

    Swift

    @objc optional func onChromecastDeviceDisconnected(_ manager: AmpChromecastManager, device: GCKDevice)

    Parameters

    ampChromecastManager

    The instance of the AMP Chromecast Manager that sends the event.

    device

    The device that triggered the event.

  • Callback called when the device manager has connected.

    Declaration

    Swift

    @objc optional func onChromecastDeviceManagerConnected(_ manager: AmpChromecastManager)

    Parameters

    ampChromecastManager

    The instance of the AMP Chromecast Manager that sends the event.

  • Callback called when the device manager has disconnected.

    Declaration

    Swift

    @objc optional func onChromecastDeviceManagerDisconnected(_ manager: AmpChromecastManager)

    Parameters

    ampChromecastManager

    The instance of the AMP Chromecast Manager that sends the event.

  • Callback called when the application has launched.

    Declaration

    Swift

    @objc optional func onChromecastLaunchedApplication(_ manager: AmpChromecastManager)

    Parameters

    ampChromecastManager

    The instance of the AMP Chromecast Manager that sends the event.

  • Callback called when the Chromecast’s media control has changed.

    Declaration

    Swift

    @objc optional func onChromecastMediaControlChanged(_ manager: AmpChromecastManager)

    Parameters

    ampChromecastManager

    The instance of the AMP Chromecast Manager that sends the event.

  • Callback called when the playback state of the manager changes.

    Declaration

    Swift

    @objc optional func onChromecastPlaybackStateChanged(_ manager: AmpChromecastManager)

    Parameters

    ampChromecastManager

    The instance of the AMP Chromecast Manager that sends the event.

  • Callback called when the position of the manager changes.

    Declaration

    Swift

    @objc optional func onChromecastPositionChanged(_ manager: AmpChromecastManager)

    Parameters

    ampChromecastManager

    The instance of the AMP Chromecast Manager that sends the event.

  • Callback called when an error occurs.

    Declaration

    Swift

    @objc optional func onChromecastError(_ manager: AmpChromecastManager, error: Error?)

    Parameters

    ampChromecastManager

    The instance of the AMP Chromecast Manager that sends the event.

    error

    The error that triggered the event.