JWCastingDelegate
@protocol JWCastingDelegate <NSObject>
The JWCastingDelegate protocol defines methods that a delegate of a JWCastController object can optionally implement to receive callbacks from the casting device.
See
JWCastController.-
Called whenever a casting device comes online. Note: scanForDevices must be called by the JWCastController object in order to start listening for devices.
See
JWCastingDevice.Declaration
Objective-C
- (void)onCastingDevicesAvailable:(nonnull NSArray<JWCastingDevice *> *)devices;Parameters
devicesList of casting devices that are currently online.
-
Called when a successful connection to a casting device is made.
See
JWCastingDevice.Declaration
Objective-C
- (void)onConnectedToCastingDevice:(nonnull JWCastingDevice *)device;Parameters
deviceThe casting device to which the castController is connected to.
-
Called when the castController is disconnected from the castDevice.
Declaration
Objective-C
- (void)onDisconnectedFromCastingDevice:(nullable NSError *)error;Parameters
errorObject containing the error message under property localizedDescription. 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
Objective-C
- (void)onConnectionTemporarilySuspended; -
Called after connection is reestablished following a temporary disconnection. Video resumes on the casting device.
Declaration
Objective-C
- (void)onConnectionRecovered; -
Called when an attempt to connect to a casting device is unsuccessful.
Declaration
Objective-C
- (void)onConnectionFailed:(nonnull NSError *)error;Parameters
errorObject containing the error message under property localizedDescription.
-
Called when casting session begins.
Declaration
Objective-C
- (void)onCasting; -
Called when an attempt to cast to a casting device is unsuccessful.
Declaration
Objective-C
- (void)onCastingFailed:(nonnull NSError *)error;Parameters
errorObject containing the error message under property localizedDescription.
-
Called when casting session ends. Note: Application might still be connected to the casting device.
Declaration
Objective-C
- (void)onCastingEnded:(nullable NSError *)error;Parameters
errorObject containing the error message under property localizedDescription. Can be nil if casting ended intentionally.
JWCastingDelegate Protocol Reference