TWCCameraCapturer Class Reference

Inherits from NSObject
Conforms to TWCVideoCapturer
Declared in TWCCameraCapturer.h

  camera

Sets/obtains the camera that is being shared.

@property (nonatomic, assign) TWCVideoCaptureSource camera

Discussion

Sets/obtains the camera that is being shared.

One of:

  • TWCVideoCaptureSourceFrontCamera
  • TWCVideoCaptureSourceBackCamera

Declared In

TWCCameraCapturer.h

  capturing

Indicates that video capture (including preview) is active.

@property (atomic, assign, readonly, getter=isCapturing) BOOL capturing

Discussion

Indicates that video capture (including preview) is active.

While interrupted, this property will return NO.

Declared In

TWCCameraCapturer.h

  delegate

The capturer’s delegate.

@property (nonatomic, weak, nullable) id<TWCCameraCapturerDelegate> delegate

Discussion

The capturer’s delegate.

Declared In

TWCCameraCapturer.h

  previewDimensions

The dimensions of the preview feed, in the frame of reference specified by the view’s orientation.

@property (nonatomic, assign, readonly) CMVideoDimensions previewDimensions

Discussion

The dimensions of the preview feed, in the frame of reference specified by the view’s orientation.

With default constraints the dimensions would be 640x480 in landscape, and 480x640 in portrait. If capture is not started then 0x0 will be returned.

Declared In

TWCCameraCapturer.h

  previewView

A view which allows you to preview the camera source. Available after calling startPreview.

@property (nonatomic, strong, readonly, nullable) TWCCameraPreviewView *previewView

Discussion

A view which allows you to preview the camera source. Available after calling startPreview.

Declared In

TWCCameraCapturer.h

  videoTrack

The capturer’s local video track.

@property (nonatomic, weak, nullable) TWCLocalVideoTrack *videoTrack

Discussion

The capturer’s local video track.

Declared In

TWCCameraCapturer.h

  interrupted

Returns YES if the capturer is currently interrupted, and NO otherwise.

@property (nonatomic, assign, readonly, getter=isInterrupted) BOOL interrupted

Discussion

Returns YES if the capturer is currently interrupted, and NO otherwise.

Declared In

TWCCameraCapturer.h

– initWithSource:

Creates the capturer with a source.

- (nonnull instancetype)initWithSource:(TWCVideoCaptureSource)source

Parameters

source

The TWCVideoCaptureSource to select.

Return Value

A camera capturer which can be used to create a TWCLocalVideoTrack.

Discussion

Creates the capturer with a source.

Declared In

TWCCameraCapturer.h

– initWithDelegate:source:

Creates the capturer with a source and delegate.

- (nonnull instancetype)initWithDelegate:(nullable id<TWCCameraCapturerDelegate>)delegate source:(TWCVideoCaptureSource)source

Parameters

delegate

The delegate which will receive callbacks from the capturer.

source

The TWCVideoCaptureSource to select.

Return Value

A camera capturer which can be used to create a TWCLocalVideoTrack.

Discussion

Creates the capturer with a source and delegate.

Declared In

TWCCameraCapturer.h

– startPreview

Starts previewing the camera.

- (BOOL)startPreview

Return Value

‘YES’ if preview started, ‘NO’ if it failed.

Discussion

Starts previewing the camera.

Note: The preview view is available after startPreview has been called.

Declared In

TWCCameraCapturer.h

– stopPreview

Stops previewing the camera.

- (BOOL)stopPreview

Return Value

‘YES’ if preview stopped, ‘NO’ if it failed.

Discussion

Stops previewing the camera.

Declared In

TWCCameraCapturer.h

– flipCamera

Flips the capturer’s camera source.

- (void)flipCamera

Discussion

Flips the capturer’s camera source.

Declared In

TWCCameraCapturer.h