IVSBroadcastSessionDelegate
Objective-C
@protocol IVSBroadcastSessionDelegate <NSObject>
Swift
protocol Delegate : NSObjectProtocol
Provide a delegate to receive status updates and errors from the SDK. Updates may be run on arbitrary threads and not the main thread.
-
Indicates that the broadcast state changed.
Declaration
Objective-C
- (void)broadcastSession:(nonnull IVSBroadcastSession *)session didChangeState:(IVSBroadcastSessionState)state;Swift
func broadcastSession(_ session: IVSBroadcastSession, didChange state: IVSBroadcastSession.State)Parameters
sessionThe
IVSBroadcastSessionthat just changed statestatecurrent broadcast state
-
Indicates that an error occurred. Errors may or may not be fatal and will be marked as such with the
IVSBroadcastErrorIsFatalKeyin theuserInfoproperty of the error.Note
In the case of a fatal error the broadcast session moves into disconnected state.
Declaration
Objective-C
- (void)broadcastSession:(nonnull IVSBroadcastSession *)session didEmitError:(nonnull NSError *)error;Swift
func broadcastSession(_ session: IVSBroadcastSession, didEmitError error: Error)Parameters
sessionThe
IVSBroadcastSessionthat just emitted the error.errorerror emitted by the SDK.
-
Indicates that a device has become available.
Note
In the case of audio devices, it is possible the system has automatically rerouted audio to this device. You can check
listAttachedDevicesto see if the attached audio devices have changed.Declaration
Objective-C
- (void)broadcastSession:(nonnull IVSBroadcastSession *)session didAddDevice:(nonnull IVSDeviceDescriptor *)descriptor;Swift
optional func broadcastSession(_ session: IVSBroadcastSession, didAddDevice descriptor: IVSDeviceDescriptor)Parameters
sessionThe
IVSBroadcastSessionthat added the devicedescriptorthe device’s descriptor
-
Indicates that a device has become unavailable.
Note
In the case of audio devices, it is possible the system has automatically rerouted audio from this device to another device. You can checklistAttachedDevicesto see if the attached audio devices have changed.It is possible that this will not be called if a device that is not in use gets disconnected. For example, if you have attached the built-in microphone to the broadcast session, but also have a bluetooth microphone paired with the device, this may not be called if the bluetooth device disconnects. Anything impacting an attached device will result in this being called however.
Declaration
Objective-C
- (void)broadcastSession:(nonnull IVSBroadcastSession *)session didRemoveDevice:(nonnull IVSDeviceDescriptor *)descriptor;Swift
optional func broadcastSession(_ session: IVSBroadcastSession, didRemoveDevice descriptor: IVSDeviceDescriptor)Parameters
sessionThe
IVSBroadcastSessionthat removed the devicedescriptorthe device’s descriptor. This may not contain specific hardware information other than IDs.
-
Periodically called with audio peak and rms in dBFS. Range is -100 (silent) to 0.
Declaration
Objective-C
- (void)broadcastSession:(nonnull IVSBroadcastSession *)session audioStatsUpdatedWithPeak:(double)peak rms:(double)rms;Swift
optional func broadcastSession(_ session: IVSBroadcastSession, audioStatsUpdatedWithPeak peak: Double, rms: Double)Parameters
sessionThe
IVSBroadcastSessionthat associated with the audio stats.peakAudio Peak over the time period
rmsAudio RMS over the time period
IVSBroadcastSessionDelegate Protocol Reference