Subscription permission API (#68)

* signal

* request

* implement

* rename event

* ref

* adjustments based on review

* override subscribed

* move events emit

* fix subscription state

* minor change

* update example for permissions demo

* format & subscriptionState as computed property

* prepare macos build

* unsubscribed event when subscription not allowed
This commit is contained in:
Hiroshi Horie
2022-01-10 23:48:44 +07:00
committed by GitHub
parent 9a37129504
commit aef1fd8804
12 changed files with 259 additions and 24 deletions
+18
View File
@@ -136,6 +136,19 @@ class _ControlsWidgetState extends State<ControlsWidget> {
}
}
void _onTapUpdateSubscribePermission() async {
final result = await context.showSubscribePermissionDialog();
if (result != null) {
try {
widget.room.localParticipant?.setTrackSubscriptionPermissions(
allParticipantsAllowed: result,
);
} catch (error) {
await context.showErrorDialog(error);
}
}
}
void _onTapSendData() async {
final result = await context.showSendDataDialog();
if (result == true) {
@@ -220,6 +233,11 @@ class _ControlsWidgetState extends State<ControlsWidget> {
icon: const Icon(EvaIcons.refresh),
tooltip: 're-connect',
),
IconButton(
onPressed: _onTapUpdateSubscribePermission,
icon: const Icon(EvaIcons.settings2),
tooltip: 'Subscribe permission',
),
],
),
);