JWCastDelegate
@objc
public protocol JWCastDelegate
Defines methods that a delegate of a JWCastController object can implement to receive casting callbacks.
-
Called whenever a new casting device comes online.
Declaration
Swift
func castController(_ controller: JWCastController, devicesAvailable devices: [JWCastingDevice]) -
Called when a successful connection to a casting device is made.
Declaration
Swift
func castController(_ controller: JWCastController, connectedTo device: JWCastingDevice)Parameters
deviceThe casting device to which the
JWCastControlleris connected to. -
Called when the casting device disconnects.
Declaration
Swift
func castController(_ controller: JWCastController, disconnectedWithError error: Error?)Parameters
errorThe potential error associated with the disconnection. Value will be nil if disconnection was purposeful.
-
Called when the connected casting device is temporarily disconnected. Video resumes on the mobile device until connection resumes.
Declaration
Swift
func castController(_ controller: JWCastController, connectionSuspendedWithDevice device: JWCastingDevice) -
Called after connection is reestablished following a temporary disconnection. Video resumes on the casting device.
Declaration
Swift
func castController(_ controller: JWCastController, connectionRecoveredWithDevice device: JWCastingDevice) -
Called when an attempt to connect to a casting device is unsuccessful.
Declaration
Swift
func castController(_ controller: JWCastController, connectionFailedWithError error: Error)Parameters
errorThe error associated with the connection failure.
-
Called when casting session begins.
Declaration
Swift
func castController(_ controller: JWCastController, castingBeganWithDevice device: JWCastingDevice) -
Called when an attempt to cast to a casting device is unsuccessful.
Declaration
Swift
func castController(_ controller: JWCastController, castingFailedWithError error: Error)Parameters
errorThe error associated with the casting failure.
-
Called when a casting session ends.
Note
Application might still be connected to the casting device.Declaration
Swift
func castController(_ controller: JWCastController, castingEndedWithError error: Error?)Parameters
errorThe potential error associated with the casting session ending. Value will be nil if casting ended intentionally.