WZCameraPreview
IntroductionThe WZCameraPreview class wraps a camera and a preview for previewing the video captured from a camera device Methods
deviceCameras+ (nonnull NSArray<WZCamera *> *) deviceCameras; Return ValueThe array of WZCamera objects DiscussionAn array of WZCamera objects available on this device initWithViewAndConfig:config:- (nonnull instancetype) initWithViewAndConfig:(nonnull UIView *)containingView config:(nonnull WowzaConfig *)aConfig; ParametersReturn ValueAn initialized WZCameraPreview object DiscussionInitialize a WZCameraPreview object isSwitchCameraAvailableForConfig:- (BOOL) isSwitchCameraAvailableForConfig:(nonnull WZMediaConfig *)config; ParametersReturn ValueYES if the other camera supports the given WZMediaConfig, otherwise NO DiscussionUse to determine if there is another camera on the device and if so, does it support the given WZMediaConfig numberOfDeviceCameras+ (NSInteger) numberOfDeviceCameras; Return ValueCount of the number of cameras available DiscussionThe number of cameras available on this device otherCamera- (nullable WZCamera *) otherCamera; Return ValueA reference to the camera not currently in use, or nil if there is only one camera. DiscussionGet a reference to the camera not currently in use, if the device has more than one camera. startPreview- (void) startPreview; DiscussionStart previewing the video stream stopPreview- (void) stopPreview; DiscussionStop previewing the video stream switchCamera- (nonnull WZCamera *) switchCamera; Return ValueThe camera switched to, or the current camera of the other camera either doesn't exist, or doesn't support the current config. DiscussionSwitch to the 'other' camera if there is another camara, and if the other camera supports the current config. TypedefsNS_ENUMtypedef NS_ENUM(NSUInteger, WZCameraPreviewGravity) { WZCameraPreviewGravityResizeAspect = 0, WZCameraPreviewGravityResizeAspectFill, WZCameraPreviewGravityResize }; Constants
DiscussionDescribes how the video preview should fill the video preview frame. See Also WZCameraPreviewGravitytypedef NS_ENUM(NSUInteger, WZCameraPreviewGravity) { WZCameraPreviewGravityResizeAspect = 0, WZCameraPreviewGravityResizeAspectFill, WZCameraPreviewGravityResize }; Constants
DiscussionDescribes how the video preview should fill the video preview frame. See Also Propertiescamera@property (nonatomic, nullable) WZCamera* camera; DiscussionThe active camera cameras@property (nonatomic, readonly, nullable) NSArray<WZCamera *> *cameras; DiscussionThe array of WZCamera objects available on this device config@property (nonatomic, nonnull) WowzaConfig *config; DiscussionThe active config for the camera previewActive@property (nonatomic, readonly, getter=isPreviewActive) BOOL previewActive; DiscussionIs video previewing currently active previewGravity@property (nonatomic, assign) WZCameraPreviewGravity previewGravity; DiscussionThe preview gravity to use for displaying the video preview; describes how the prview will fill the given view bounds previewLayer@property (nonatomic, readonly, nullable) AVCaptureVideoPreviewLayer *previewLayer; DiscussionThe AV Foundation preview layer. Will be null until startPreview is called. |