private void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e)
        {
            SubscriberUpdated?.Invoke();

            if (messagesOpentok.type == (int)CallStatus.CancellRing)
            {
                VideoCallStatus((int)CallStatus.CancellRing, null, true, false);
            }
        }
        private void OnStreamDestroyed(object sender, Session.StreamDroppedEventArgs e)
        {
            SubscriberUpdated?.Invoke();

            if (messagesOpentok.type == (int)CallStatus.CancellRing)
            {
                _medicalVideoCall.VideoCallStatusAsync((int)CallStatus.CancellRing, null, true);
            }
        }
Example #3
0
        public async Task UpdateStatusAsync(SubscriberUpdated message)
        {
            MeasureEntity measure = await _measureContext.Measures
                                    .FirstOrDefaultAsync(m => m.Id == message.MeasureId);

            measure.Status   = message.Status;
            measure.Comments = message.Comment;

            await _measureContext.SaveChangesAsync();
        }
 private void OnSubscriberDidConnectToStream(object sender, EventArgs e)
 {
     lock (_locker)
     {
         if (SubscriberKit != null)
         {
             SubscriberUpdated?.Invoke();
             IsSubscriberVideoEnabled = SubscriberKit?.Stream?.HasVideo ?? false;
             PublisherUpdated?.Invoke();
         }
     }
 }
 private void OnSubscriberConnectionChanged(bool isConnected)
 {
     lock (_locker)
     {
         if (SubscriberKit != null)
         {
             SubscriberUpdated?.Invoke();
             IsSubscriberConnected    = isConnected;
             IsSubscriberVideoEnabled = SubscriberKit?.Stream?.HasVideo ?? false;
             PublisherUpdated?.Invoke();
         }
     }
 }
 private void OnSubscriberConnectionChanged(bool isConnected, OTSubscriber subscriberKit)
 {
     lock (_locker)
     {
         if (subscriberKit?.Stream != null)
         {
             if (Subscribers.ContainsKey(subscriberKit.Stream.StreamId))
             {
                 SubscriberUpdated?.Invoke(this, new OpenTokUserUpdatedEventArgs(subscriberKit.Stream.StreamId));
                 IsSubscriberConnected    = isConnected;
                 IsSubscriberVideoEnabled = subscriberKit.Stream?.HasVideo ?? false;
                 PublisherUpdated?.Invoke(this, new OpenTokUserUpdatedEventArgs(PublisherKit.Session.SessionId));
             }
         }
     }
 }
        private void OnStreamCreated(object sender, Session.StreamReceivedEventArgs e)
        {
            lock (_locker)
            {
                if (Session == null ||
                    SubscriberKit != null)
                {
                    return;
                }

                SubscriberKit                = new Subscriber.Builder(CrossCurrentActivity.Current.AppContext, e.P1).Build();
                SubscriberKit.Connected     += OnSubscriberDidConnectToStream;
                SubscriberKit.VideoDisabled += OnSubscriberVideoDisabled;
                SubscriberKit.VideoEnabled  += OnSubscriberVideoEnabled;

                SubscriberKit.SetStyle(BaseVideoRenderer.StyleVideoScale, BaseVideoRenderer.StyleVideoFill);
                SubscriberKit.SubscribeToAudio = IsAudioSubscriptionEnabled;
                SubscriberKit.SubscribeToVideo = IsVideoSubscriptionEnabled;
                SubscriberUpdated?.Invoke();
                Session.Subscribe(SubscriberKit);
            }
        }
        private void OnStreamCreated(object sender, OTSessionDelegateStreamEventArgs e)
        {
            lock (_locker)
            {
                if (Session == null || SubscriberKit != null)
                {
                    return;
                }

                SubscriberKit = new OTSubscriber(e.Stream, null)
                {
                    SubscribeToVideo = IsVideoSubscriptionEnabled
                };
                SubscriberKit.DidConnectToStream      += OnSubscriberConnected;
                SubscriberKit.DidDisconnectFromStream += OnSubscriberDisconnected;
                SubscriberKit.VideoDataReceived       += OnSubscriberVideoDataReceived;
                SubscriberKit.VideoEnabled            += OnSubscriberVideoEnabled;
                SubscriberKit.VideoDisabled           += OnSubscriberVideoDisabled;
                SubscriberKit.SubscribeToAudio         = IsAudioSubscriptionEnabled;
                SubscriberUpdated?.Invoke();
                Session.Subscribe(SubscriberKit, out OTError error);
            }
        }
Example #9
0
 private PlatformOpenTokService RaiseSubscriberUpdated()
 {
     SubscriberUpdated?.Invoke();
     return(this);
 }
 private void OnSubscriberVideoDataReceived(object sender, EventArgs e)
 => SubscriberUpdated?.Invoke();
 private void OnStreamDestroyed(object sender, Session.StreamDroppedEventArgs e) => SubscriberUpdated?.Invoke();
 private void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e) => SubscriberUpdated?.Invoke(this, EventArgs.Empty);
 private void OnSubscriberVideoDataReceived(object sender, EventArgs e)
 => SubscriberUpdated?.Invoke(sender, new OpenTokUserUpdatedEventArgs(((OTSubscriber)sender).Stream.StreamId));
 private void OnStreamDestroyed(object sender, OTSessionDelegateStreamEventArgs e) => SubscriberUpdated?.Invoke(sender, new OpenTokUserUpdatedEventArgs(e.Stream.StreamId));
Example #15
0
 public async Task UpdateStatusAsync(SubscriberUpdated message)
 {
     await _measureRepository.UpdateStatusAsync(message);
 }
 private void OnStreamDropped(object sender, Session.StreamDroppedEventArgs e) => SubscriberUpdated?.Invoke(sender, new OpenTokUserUpdatedEventArgs(e.P1.StreamId));