Release camera/mic when muted, restartTrack when unmuted (#39)

* re-structure tracks

* publication.track is now a LocalTrack or RemoteTrack

* restartTrack when unmute

* stop/start on restartTrack

* move to mute/unmute

* format

* remove comment
This commit is contained in:
Hiroshi Horie
2021-11-30 15:58:19 +07:00
committed by GitHub
parent 9e0a3b19fe
commit 8037d80674
18 changed files with 279 additions and 239 deletions
+2 -3
View File
@@ -104,10 +104,9 @@ class _ControlsWidgetState extends State<ControlsWidget> {
await FlutterBackground.initialize(androidConfig: androidConfig);
await FlutterBackground.enableBackgroundExecution();
final screenTrack =
await LocalVideoTrack.createScreenTrack(); // Defaults to camera
final screenShareTrack = await LocalVideoTrack.createScreenShareTrack();
await widget.room.localParticipant.publishVideoTrack(
screenTrack,
screenShareTrack,
);
} catch (e) {
print('could not publish video: $e');