TVILocalDataTrack Class Reference

Inherits from TVIDataTrack : TVITrack : NSObject
Declared in TVILocalDataTrack.h

Overview

A data track represents a unidirectional data source that can be used to send messages to participants of a Room.

– init

Developers shouldn’t initialize this class directly.

- (null_unspecified instancetype)init

Discussion

Use track or trackWithOptions:name: to create a TVILocalDataTrack.

Declared In

TVILocalDataTrack.h

– sendString:

Send a string message.

- (void)sendString:(nonnull NSString *)message

Parameters

message

The string message.

Declared In

TVILocalDataTrack.h

– sendData:

Send a binary message.

- (void)sendData:(nonnull NSData *)message

Parameters

message

The binary message.

Declared In

TVILocalDataTrack.h

+ track

Creates a TVILocalDataTrack with the default settings.

+ (nullable instancetype)track

Return Value

A Track which is ready to be shared with Participants in a Room, or nil if an error occurs.

Discussion

This method uses the default TVIDataTrackOptions, and produces an enabled Track.

Declared In

TVILocalDataTrack.h

+ trackWithOptions:

Creates a TVILocalDataTrack with TVIDataTrackOptions.

+ (nullable instancetype)trackWithOptions:(nullable TVIDataTrackOptions *)options

Parameters

options

An instance of TVIDataTrackOptions to configure the Track.

Return Value

A Track which is ready to be shared with Participants in a Room, or nil if an error occurs.

Discussion

This method allows you to provide specific TVIDataTrackOptions.

Declared In

TVILocalDataTrack.h