@@ -13,6 +13,7 @@ import '../participant/remote_participant.dart';
|
||||
import '../proto/livekit_models.pb.dart' as lk_models;
|
||||
import '../proto/livekit_rtc.pb.dart' as lk_rtc;
|
||||
import '../track/remote.dart';
|
||||
import '../types.dart';
|
||||
import '../utils.dart';
|
||||
import 'track_publication.dart';
|
||||
|
||||
@@ -40,6 +41,27 @@ class RemoteTrackPublication<T extends RemoteTrack>
|
||||
lk_models.VideoQuality _videoQuality = lk_models.VideoQuality.HIGH;
|
||||
lk_models.VideoQuality get videoQuality => _videoQuality;
|
||||
|
||||
StreamState _streamState = StreamState.paused;
|
||||
|
||||
/// The server may pause the track when they are bandwidth limitations and resume
|
||||
/// when there is more capacity. This property will be updated when the track is
|
||||
/// paused / resumed by the server. See [TrackStreamStateUpdatedEvent] for the
|
||||
/// relevant event.
|
||||
StreamState get streamState => _streamState;
|
||||
|
||||
@internal
|
||||
Future<void> updateStreamState(StreamState streamState) async {
|
||||
// return if no change
|
||||
if (_streamState == streamState) return;
|
||||
_streamState = streamState;
|
||||
[participant.events, participant.room.events]
|
||||
.emit(TrackStreamStateUpdatedEvent(
|
||||
participant: participant,
|
||||
trackPublication: this,
|
||||
streamState: streamState,
|
||||
));
|
||||
}
|
||||
|
||||
// used to report renderer visibility to the server
|
||||
// and optimize
|
||||
final _visibilities = <String, RendererVisibility>{};
|
||||
|
||||
Reference in New Issue
Block a user