WOWZCameraPreview
IntroductionThe WOWZCameraPreview class allows you to preview video captured from a camera device. Methods
deviceCameras+ (nonnull NSArray<WOWZCamera *> *) deviceCameras; Return ValueThe array of WOWZCamera objects. DiscussionGets an array of the WOWZCamera objects available on the device. initWithViewAndConfig:config:- (nonnull instancetype) initWithViewAndConfig:(nonnull UIView *)containingView config:(nonnull WowzaConfig *)aConfig; ParametersReturn ValueAn initialized WOWZCameraPreview object. DiscussionInitializes a WOWZCameraPreview object. isSwitchCameraAvailableForConfig:- (BOOL) isSwitchCameraAvailableForConfig:(nonnull WOWZMediaConfig *)config; ParametersReturn ValueYes if the device has another camera that supports the specified WOWZMediaConfig, no otherwise. DiscussionIndicates whether another camera is available on the device and whether that camera supports the specified WOWZMediaConfig. numberOfDeviceCameras+ (NSInteger) numberOfDeviceCameras; Return ValueThe number of cameras available. DiscussionGets the number of cameras available on the device. otherCamera- (nullable WOWZCamera *) otherCamera; Return ValueThe reference to the camera not in use, or nil if there's only one camera. DiscussionGets a reference to the camera not currently in use, if the device has more than one camera. startPreview- (void) startPreview; DiscussionStarts previewing the video stream. stopPreview- (void) stopPreview; DiscussionStops previewing the video stream. switchCamera- (nonnull WOWZCamera *) switchCamera; Return ValueThe device's other camera, if it exists and supports the current config; otherwise, the same camera. DiscussionSwitches to the device's other camera. TypedefsNS_ENUMtypedef NS_ENUM(NSUInteger, WOWZCameraPreviewGravity) { WOWZCameraPreviewGravityResizeAspect = 0, WOWZCameraPreviewGravityResizeAspectFill, WOWZCameraPreviewGravityResize }; Constants
DiscussionDescribes how the video should fill the preview frame. See Also WOWZCameraPreviewGravitytypedef NS_ENUM(NSUInteger, WOWZCameraPreviewGravity) { WOWZCameraPreviewGravityResizeAspect = 0, WOWZCameraPreviewGravityResizeAspectFill, WOWZCameraPreviewGravityResize }; Constants
DiscussionDescribes how the video should fill the preview frame. See Also Propertiescamera@property (nonatomic, nullable) WOWZCamera* camera; DiscussionThe active camera. cameras@property (nonatomic, readonly, nullable) NSArray<WOWZCamera *> *cameras; DiscussionThe array of WOWZCamera objects available on the device. config@property (nonatomic, nonnull) WowzaConfig *config; DiscussionThe active config for the camera. previewActive@property (nonatomic, readonly, getter=isPreviewActive) BOOL previewActive; DiscussionIndicates whether a video is actively previewing. previewGravity@property (nonatomic, assign) WOWZCameraPreviewGravity previewGravity; DiscussionThe preview gravity to use to display the video preview. Preview gravity describes how the video should fill the available screen area. previewLayer@property (nonatomic, readonly, nullable) AVCaptureVideoPreviewLayer *previewLayer; DiscussionThe AV Foundation preview layer. Null until startPreview is called. |