IVSCameraDelegate
Objective-C
@protocol IVSCameraDelegate <NSObject>
Swift
protocol IVSCameraDelegate : NSObjectProtocol
A delegate that provides updates about the attached camera on the main queue.
-
Invoked when the underlying input source providing video samples to the camera changes, for example, when the video source is changed from the front-facing camera to the back-facing camera or when the camera is attached to an IVSBroadcastSession or IVSStage that is configured for a certain FPS and resolution, causing the camera to reconfigure its input source to be more performant.
Declaration
Objective-C
- (void) underlyingInputSourceChangedFor:(nonnull id<IVSCamera>)camera to:(nonnull IVSDeviceDescriptor *)inputSource with:(nonnull IVSCameraFormat *)format;
Swift
optional func underlyingInputSourceChanged(for camera: any IVSCamera, to inputSource: IVSDeviceDescriptor, with format: IVSCameraFormat)
Parameters
camera
The camera that had it’s underlying input source changed.
inputSource
The new input source. If this is
nil
it means there is no available input source to record from. The camera’s video zoom factor will reset to 1.0 when the input source for the camera changes. -
Invoked after the
-[IVSCamera setVideoZoomFactor:]
API successfully changes the AVCaptureDevice’s zoom factor.Declaration
Objective-C
- (void)videoZoomFactorChangedFor:(nonnull id<IVSCamera>)camera to:(CGFloat)videoZoomFactor;
Swift
optional func videoZoomFactorChanged(for camera: any IVSCamera, to videoZoomFactor: CGFloat)
Parameters
camera
The camera that had it’s zoom factor changed.
zoomFactor
The new zoom factor on the IVSCamera object. This method will not be called when the input source for the camera changes – as mentioned above, the zoom factor will be reset to 1.0 in that case.