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.
trackId
A unique identifier for the TVILocalDataTrack
.
@property (nonatomic, copy, readonly, nonnull) NSString *trackId
Discussion
The trackId
is generated by the Client. The Server assigns a SID for the track publication.
Declared In
TVILocalDataTrack.h
– 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 |
---|
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