Add audio-only WebRTC calls

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paul Schneider 2026-11-16 01:42:53 +00:00
commit 97e197996f
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
26 changed files with 384 additions and 94 deletions

View file

@ -37,10 +37,12 @@ internal sealed class AndroidWebRtcMedia : WebRtcNativeMedia
protected override async Task StartCoreAsync(WebRtcMediaConfiguration configuration, CancellationToken ct)
{
var activity = MainActivity.Current ?? throw new InvalidOperationException("Activité Android indisponible.");
await PodcastPermissions.EnsureAsync(activity, microphone: true, ct, notifications: false);
await PodcastPermissions.EnsureAsync(activity, microphone: true, ct, notifications: false,
camera: !configuration.AudioOnly);
if (!MainActivity.IsForeground)
throw new InvalidOperationException("Revenez dans PostIt pour demarrer l'appel.");
await Task.WhenAll(_local.Ready, _remote.Ready).WaitAsync(TimeSpan.FromSeconds(10), ct);
if (!configuration.AudioOnly)
await Task.WhenAll(_local.Ready, _remote.Ready).WaitAsync(TimeSpan.FromSeconds(10), ct);
await SendCommandAsync(StartCommand(configuration), ct);
}