private void OnStreamCreated(object sender, OTSessionDelegateStreamEventArgs e) { if (Session == null) { return; } DestroyStream(e.Stream?.StreamId); var subscriberKit = new OTSubscriber(e.Stream, null) { SubscribeToVideo = IsVideoSubscriptionEnabled, SubscribeToAudio = IsAudioSubscriptionEnabled }; subscriberKit.DidConnectToStream += OnSubscriberConnected; subscriberKit.DidDisconnectFromStream += OnSubscriberDisconnected; subscriberKit.VideoDataReceived += OnSubscriberVideoDataReceived; subscriberKit.VideoEnabled += OnSubscriberVideoEnabled; subscriberKit.VideoDisabled += OnSubscriberVideoDisabled; Session.Subscribe(subscriberKit); var streamId = e.Stream.StreamId; _subscribers.Add(subscriberKit); _subscriberStreamIds.Add(streamId); }
private void OnStreamCreated(object sender, OTSessionDelegateStreamEventArgs e) { lock (_locker) { if (Session == null || Subscribers != null && Subscribers.ContainsKey(e.Stream.StreamId)) { return; } var subscriberKit = new OTSubscriber(e.Stream, null) { SubscribeToVideo = IsVideoSubscriptionEnabled, SubscribeToAudio = IsAudioSubscriptionEnabled }; subscriberKit.DidConnectToStream += OnSubscriberConnected; subscriberKit.DidDisconnectFromStream += OnSubscriberDisconnected; subscriberKit.VideoDataReceived += OnSubscriberVideoDataReceived; subscriberKit.VideoEnabled += OnSubscriberVideoEnabled; subscriberKit.VideoDisabled += OnSubscriberVideoDisabled; Session.Subscribe(subscriberKit); Subscribers?.Add(e.Stream.StreamId, subscriberKit); OnSubscriberAdded(e.Stream.StreamId); } }
private void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e) { _myStreamContainer.InvokeOnMainThread(() => { DeactivateStreamContainer(_myStreamContainer); DeactivateStreamContainer(_otherStreamContainer); }); }
private void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e) { SubscriberUpdated?.Invoke(); if (messagesOpentok.type == (int)CallStatus.CancellRing) { VideoCallStatus((int)CallStatus.CancellRing, null, true, false); } }
void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e) { PublisherContianer?.InvokeOnMainThread(() => { DeactivateStreamContainer(PublisherContianer); }); SubscriberContainer?.InvokeOnMainThread(() => { DeactivateStreamContainer(SubscriberContainer); }); }
private void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e) { var streamId = e.Stream.StreamId; var subscriberKit = _subscribers.FirstOrDefault(x => x.Stream?.StreamId == streamId); if (subscriberKit != null) { ClearSubscriber(subscriberKit); _subscribers.Remove(subscriberKit); } _subscriberStreamIds.Remove(streamId); RaiseSubscriberUpdated(); }
void OnStreamCreated(object sender, OTSessionDelegateStreamEventArgs e) { lock (syncLock) { if (Subscriber != null || Session == null) { return; } Subscriber = new OTSubscriber(e.Stream, null); HandleSubscriptionEvents(); Session.Subscribe(Subscriber, out var error); } }
private void OnStreamCreated(object sender, OTSessionDelegateStreamEventArgs e) { lock (_locker) { if (Session == null || SubscriberKit != null) { return; } SubscriberKit = new OTSubscriber(e.Stream, null); SubscriberKit.SubscribeToVideo = IsVideoSubscriptionEnabled; SubscriberKit.SubscribeToVideo = IsAudioSubscriptionEnabled; SubscriberKit.DidConnectToStream += OnSubscriberDidConnectToStream; SubscriberKit.VideoDataReceived += OnSubscriberVideoDataReceived; SubscriberKit.VideoEnabled += OnSubscriberVideoEnabled; SubscriberKit.VideoDisabled += OnSubscriberVideoDisabled; OTError error; Session.Subscribe(SubscriberKit, out error); } }
private void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e) => DestroyStream(e.Stream?.StreamId);
private void OnStreamCreated(object sender, OTSessionDelegateStreamEventArgs e) { Subscribe(e.Stream); }
private void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e) => SubscriberUpdated?.Invoke(this, EventArgs.Empty);
private void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e) => SubscriberUpdated?.Invoke(sender, new OpenTokUserUpdatedEventArgs(e.Stream.StreamId));