Fix: Visibility Optimization randomly not working (#65)
* use widget id instead of state id * ignore local video view events * switch remote view visibility also * use Key for a reliable id * remove local check * clean up * redesign * check mounted * remove mount check * more optimization * quick wake up * mark internal * rename to adaptiveStream
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
@@ -16,7 +17,25 @@ import 'audio.dart';
|
||||
import 'video.dart';
|
||||
|
||||
/// Used to group [LocalVideoTrack] and [RemoteVideoTrack].
|
||||
mixin VideoTrack on Track {}
|
||||
mixin VideoTrack on Track {
|
||||
@internal
|
||||
final List<GlobalKey> viewKeys = [];
|
||||
|
||||
@internal
|
||||
Function(Key)? onVideoViewBuild;
|
||||
|
||||
@internal
|
||||
GlobalKey addViewKey() {
|
||||
final key = GlobalKey();
|
||||
viewKeys.add(key);
|
||||
return key;
|
||||
}
|
||||
|
||||
@internal
|
||||
void removeViewKey(GlobalKey key) {
|
||||
viewKeys.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
/// Used to group [LocalAudioTrack] and [RemoteAudioTrack].
|
||||
mixin AudioTrack on Track {}
|
||||
|
||||
Reference in New Issue
Block a user