public MeetingResult Unsubscribe(int accountId, int resourceId, MediaType mediaType) { UserUnpublishModel userUnpublishModel = new UserUnpublishModel() { AccountId = accountId, ResourceId = resourceId, }; MeetingResult result = _meetingSdkWrapper.Unsubscribe(userUnpublishModel); if (result.StatusCode == 0) { Participant participant; if (_participants.TryGetValue(accountId, out participant)) { var resource = participant.Resources.SingleOrDefault(m => m.ResourceId == resourceId); if (resource != null) { resource.IsUsed = false; } } VideoBoxType videoBoxType; if (mediaType.TryConvertVideoBoxType(out videoBoxType)) { VideoBoxManager.Release( accountId, videoBoxType == VideoBoxType.Camera ? VideoBoxType.None : videoBoxType); } } LayoutChanged(mediaType); return(result); }
void UserUnpublishMicAudio(UserUnpublishModel model) { Participant participant; if (_participants.TryGetValue(model.AccountId, out participant)) { participant.Resources.RemoveWhere(res => res.ResourceId == model.ResourceId); MeetingResult result = Unsubscribe(model.AccountId, model.ResourceId, MediaType.Microphone); if (result.StatusCode == 0) { } } }
void UserUnpublishDataVideo(UserUnpublishModel model) { Participant participant; if (_participants.TryGetValue(model.AccountId, out participant)) { participant.Resources.RemoveWhere(res => res.ResourceId == model.ResourceId); MeetingResult result = Unsubscribe(model.AccountId, model.ResourceId, MediaType.VideoDoc); if (result.StatusCode == 0) { VideoBoxManager.Release(model.AccountId, VideoBoxType.DataCard); } } }