|
LiveKit C++ SDK
Real-time audio/video SDK for C++
|
#include <remote_data_track.h>
Public Member Functions | |
| RemoteDataTrack (const RemoteDataTrack &)=delete | |
| RemoteDataTrack & | operator= (const RemoteDataTrack &)=delete |
| const DataTrackInfo & | info () const noexcept |
| Metadata about this data track. | |
| const std::string & | publisherIdentity () const noexcept |
| Identity of the remote participant who published this track. | |
| bool | isPublished () const |
| Whether the track is still published by the remote participant. | |
| Result< std::shared_ptr< DataTrackStream >, SubscribeDataTrackError > | subscribe (const DataTrackStream::Options &options={}) |
Friends | |
| class | Room |
Represents a data track published by a remote participant.
Discovered via the DataTrackPublishedEvent room event. Unlike audio/video tracks, remote data tracks require an explicit subscribe() call to begin receiving frames.
Typical usage:
// In RoomDelegate::onDataTrackPublished callback: auto sub_result = remoteDataTrack->subscribe(); if (sub_result) { auto sub = sub_result.value(); DataTrackFrame frame; while (sub->read(frame)) { // process frame } }
| Result< std::shared_ptr< DataTrackStream >, SubscribeDataTrackError > livekit::RemoteDataTrack::subscribe | ( | const DataTrackStream::Options & | options = {} | ) |
Subscribe to this remote data track.
Returns a DataTrackStream that delivers frames via blocking read(). Destroy the stream to unsubscribe.