updateAvailableActions method
Updates the set of media actions available in system controls.
Actions not in actions will be disabled (hidden or greyed out)
in the notification and lock screen. Pass null to enable all actions.
Implementation
@override
Future<void> updateAvailableActions(Set<MediaAction>? actions) async {
try {
final session = web.window.navigator.mediaSession;
for (final entry in _webActionMap.entries) {
if (actions == null || actions.contains(entry.value)) {
_registerAction(session, entry.key, entry.value);
} else {
// Unregister by setting handler to null
try {
session.setActionHandler(entry.key, null);
} catch (_) {}
}
}
} catch (_) {}
}