TVILocalMedia Class Reference

Inherits from NSObject
Declared in TVILocalMedia.h

Overview

TVILocalMedia is a collection of audio and video tracks which can be shared in a TVIRoom.

The lifecycle of TVILocalMedia is independent of TVIRoom. The same media can be shared in zero, one, or many Rooms.

  audioController

The Audio Controller.

@property (nonatomic, strong, readonly, nonnull) TVIAudioController *audioController

Declared In

TVILocalMedia.h

  audioTracks

A collection of local audio tracks.

@property (nonatomic, strong, readonly, nonnull) NSArray<TVILocalAudioTrack*> *audioTracks

Declared In

TVILocalMedia.h

  videoTracks

A collection of local video tracks.

@property (nonatomic, strong, readonly, nonnull) NSArray<TVILocalVideoTrack*> *videoTracks

Declared In

TVILocalMedia.h

– addAudioTrack:

Adds a local audio track to TVILocalMedia.

- (nullable TVILocalAudioTrack *)addAudioTrack:(BOOL)enabled

Parameters

enabled

Specifies if TVILocalAudioTrack should be enabled or disabled initially.

Return Value

An instance of TVILocalAudioTrack if successful, or nil if not.

Declared In

TVILocalMedia.h

– addAudioTrack:constraints:error:

Adds a local video track to TVILocalMedia.

- (nullable TVILocalAudioTrack *)addAudioTrack:(BOOL)enabled constraints:(nullable TVIAudioConstraints *)constraints error:(NSError *_Nullable *_Nullable)error

Parameters

enabled

Specifies if TVILocalAudioTrack should be enabled or disabled initially.

constraints

The audio constraints.

error

An NSError which will be filled out if the operation fails, or set to nil on success.

Return Value

An instance of TVILocalAudioTrack if successful, or nil if not.

Declared In

TVILocalMedia.h

– removeAudioTrack:

Removes a local audio track from TVILocalMedia

- (BOOL)removeAudioTrack:(nonnull TVILocalAudioTrack *)track

Parameters

track

The TVILocalAudioTrack to attempt to remove from TVILocalMedia.

Return Value

YES if successful, or NO if the removal fails.

Declared In

TVILocalMedia.h

– removeAudioTrack:error:

Removes a local audio track from TVILocalMedia

- (BOOL)removeAudioTrack:(nonnull TVILocalAudioTrack *)track error:(NSError *_Nullable *_Nullable)error

Parameters

track

The TVILocalAudioTrack to attempt to remove from TVILocalMedia.

error

An NSError which will be filled out if the operation fails, or set to nil on success.

Return Value

YES if successful, or NO if the removal fails.

Declared In

TVILocalMedia.h

– addVideoTrack:capturer:

Adds a local video track to TVILocalMedia.

- (nullable TVILocalVideoTrack *)addVideoTrack:(BOOL)enabled capturer:(nonnull id<TVIVideoCapturer>)capturer

Parameters

enabled

Specifies if TVILocalVideoTrack should be enabled or disabled initially.

capturer

A video capturer which conforms to TVIVideoCapturer. Note that only TVICameraCapturer and TVIScreenCapturer classes are supported for now.

Return Value

An instance of TVILocalVideoTrack if successful, or nil if not.

Declared In

TVILocalMedia.h

– addVideoTrack:capturer:constraints:error:

Adds a local video track to TVILocalMedia.

- (nullable TVILocalVideoTrack *)addVideoTrack:(BOOL)enabled capturer:(nonnull id<TVIVideoCapturer>)capturer constraints:(nullable TVIVideoConstraints *)constraints error:(NSError *_Nullable *_Nullable)error

Parameters

enabled

Specifies if TVILocalVideoTrack should be enabled or disabled initially.

capturer

A video capturer which conforms to TVIVideoCapturer. Note that only TVICameraCapturer and TVIScreenCapturer classes are supported for now.

constraints

The TVIVideoConstraints to use. If nil is passed then the default constraints are used instead. Default values are determined based upon your device model. For 64-bit devices the default is 640x480x30. If you are using an older A5 device then 480x360x15 is returned, and for A5x, and A6 devices 480x360x20 is used instead.

error

An NSError which will be filled out if the operation fails, or set to nil on success.

Return Value

An instance of TVILocalVideoTrack if successful, or nil if not.

Declared In

TVILocalMedia.h

– removeVideoTrack:

Removes a local video track from TVILocalMedia

- (BOOL)removeVideoTrack:(nonnull TVILocalVideoTrack *)track

Parameters

track

The TVILocalVideoTrack to attempt to remove from TVILocalMedia.

Return Value

YES if success, NO if failure.

Declared In

TVILocalMedia.h

– removeVideoTrack:error:

To remove local video track from TVILocalMedia.

- (BOOL)removeVideoTrack:(nonnull TVILocalVideoTrack *)track error:(NSError *_Nullable *_Nullable)error

Parameters

track

The TVILocalVideoTrack to attempt to remove from TVILocalMedia.

error

An NSError which will be filled out if the operation fails, or set to nil on success.

Declared In

TVILocalMedia.h