TVICameraCapturer Class Reference

Inherits from NSObject
Conforms to TVIVideoCapturer
Declared in TVICameraCapturer.h

Overview

TVICameraCapturer allows you to preview and share video captured from the device’s built in camera(s).

  source

Obtains the camera that is being shared.

@property (nonatomic, assign, readonly) TVICameraCaptureSource source

Declared In

TVICameraCapturer.h

  capturing

Indicates that video capture (including preview) is active.

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

Discussion

While interrupted, this property will return NO.

Declared In

TVICameraCapturer.h

  delegate

The capturer’s delegate.

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

Declared In

TVICameraCapturer.h

  previewView

A view which allows you to preview the camera source.

@property (nonatomic, strong, readonly, nonnull) TVICameraPreviewView *previewView

Discussion

previewView will be nil unless the TVICameraCapturer is initialized with the initWithSource:delegate:enablePreview: initializer, passing YES as the enablePreview argument.

Declared In

TVICameraCapturer.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

TVICameraCapturer.h

– init

Initializes the capturer with TVICameraCaptureSourceFrontCamera.

- (null_unspecified instancetype)init

Return Value

A camera capturer which can be used to create a TVILocalVideoTrack if TVICameraCaptureSourceFrontCamera is available, otherwise nil.

Declared In

TVICameraCapturer.h

– initWithSource:

Initializes the capturer with a source.

- (nullable instancetype)initWithSource:(TVICameraCaptureSource)source

Parameters

source

The TVICameraCaptureSource to select initially.

Return Value

A camera capturer which can be used to create a TVILocalVideoTrack if the video capture source is available, otherwise nil.

Declared In

TVICameraCapturer.h

– initWithSource:delegate:

Creates the capturer with a source and delegate.

- (nullable instancetype)initWithSource:(TVICameraCaptureSource)source delegate:(nullable id<TVICameraCapturerDelegate>)delegate

Parameters

source

The TVICameraCaptureSource to select initially.

delegate

An object which conforms to TVICameraCapturerDelegate that will receive callbacks from the capturer.

Return Value

A camera capturer which can be used to create a TVILocalVideoTrack if the video capture source is available, otherwise nil.

Declared In

TVICameraCapturer.h

– initWithSource:delegate:enablePreview:

Creates the capturer with a source, delegate and whether the preview feed should be generated.

- (nullable instancetype)initWithSource:(TVICameraCaptureSource)source delegate:(nullable id<TVICameraCapturerDelegate>)delegate enablePreview:(BOOL)enablePreview

Parameters

source

The TVICameraCaptureSource to select initially.

delegate

An object which conforms to TVICameraCapturerDelegate that will receive callbacks from the capturer.

enablePreview

Whether the capturer should provide the preview feed via the previewView.

Return Value

A camera capturer which can be used to create a TVILocalVideoTrack if the video capture source is available, otherwise nil.

Declared In

TVICameraCapturer.h

– selectSource:

Selects a new camera source.

- (BOOL)selectSource:(TVICameraCaptureSource)source

Parameters

source

The camera source to select.

Return Value

YES if the source is available, otherwise NO.

Declared In

TVICameraCapturer.h

+ isSourceAvailable:

Checks if a TVICameraCaptureSource is available on your device.

+ (BOOL)isSourceAvailable:(TVICameraCaptureSource)source

Parameters

source

The source to check.

Return Value

YES if the source is available, or NO if it is not.

Declared In

TVICameraCapturer.h

+ availableSources

Returns all of the sources which are available on your device.

+ (nonnull NSArray<NSNumber*> *)availableSources

Return Value

An NSArray containing zero or more NSNumber objects which wrap TVICameraCaptureSource.

Discussion

If you are on an iOS simulator you should not expect any sources to be returned.

Declared In

TVICameraCapturer.h