private void UserStartSpeak(UserSpeakModel obj) { Participant p; if (_participants.TryGetValue(obj.Account.AccountId, out p)) { p.IsSpeaking = true; VideoBoxManager.Release(obj.Account.AccountId); } }
private void UserStopSpeak(UserSpeakModel obj) { Participant participant; if (_participants.TryGetValue(obj.Account.AccountId, out participant)) { participant.IsSpeaking = false; var resources = participant.Resources.ToList(); foreach (var streamResource in resources) { Unsubscribe(participant.Account.AccountId, streamResource.ResourceId, streamResource.MediaType); //Async.Create(() => Unsubscribe(participant.Account.AccountId, streamResource.ResourceId, streamResource.MediaType)) // .TryRun($"用户停止发言 - 取消订阅失败{streamResource.MediaType}。"); } participant.Resources.Clear(); VideoBoxManager.Release(obj.Account.AccountId); } }