public override void onStreamDestroyed(PublisherKit publisher, Stream stream) { if (OpenTokConfig.SUBSCRIBE_TO_SELF && mSubscriber != null) { unsubscriberFromStream(stream); } }
public override void onStreamDestroyed(PublisherKit publisher, Stream stream) { if ((com.opentok.android.demo.config.OpenTokConfig.SUBSCRIBE_TO_SELF && mSubscriber != null)) { unsubscribeFromStream(stream); } }
private void OnConnected(object sender, Session.ConnectedEventArgs e) { if (Session == null) { return; } ClearPublisher(); using (var builder = new Publisher.Builder(CrossCurrentActivity.Current.AppContext) .Resolution(Publisher.CameraCaptureResolution.High) .VideoTrack(Permissions.HasFlag(OpenTokPermission.Camera)) .AudioTrack(Permissions.HasFlag(OpenTokPermission.RecordAudio)) .Name("XamarinOpenTok")) { PublisherKit = builder.Build(); PublisherKit.PublishVideo = IsVideoPublishingEnabled; PublisherKit.PublishAudio = IsAudioPublishingEnabled; PublisherKit.SetStyle(BaseVideoRenderer.StyleVideoScale, BaseVideoRenderer.StyleVideoFill); PublisherKit.StreamCreated += OnPublisherStreamCreated; PublisherKit.AudioFallbackEnabled = PublisherVideoType == OpenTokPublisherVideoType.Camera; PublisherKit.PublisherVideoType = PublisherVideoType == OpenTokPublisherVideoType.Camera ? PublisherKit.PublisherKitVideoType.PublisherKitVideoTypeCamera : PublisherKit.PublisherKitVideoType.PublisherKitVideoTypeScreen; Session.Publish(PublisherKit); RaisePublisherUpdated(); } }
public void OnStreamCreated(PublisherKit publisher, Stream stream) { mStreams.Add(stream); if (mSubscriber == null) { SubscribeToStream(stream); } }
public void OnStreamDestroyed(PublisherKit p0, Com.Opentok.Android.Stream p1) { if ((this._subscriber != null)) { UnsubscribeFromStream(p1); } }
public void OnStreamCreated(PublisherKit p0, Stream p1) { _streams.Add (p1); if (_subscriber == null) { SubscribeToStream (p1); } }
public void OnStreamDestroyed(PublisherKit p0, Stream p1) { if (_subscriber != null) { UnsubscribeFromStream(p1); } }
public override void EndSession(bool sendBackToRoot, bool showEvaluateCall) { try { if (Session == null && SubscriberKit == null && PublisherKit == null) { return; } lock (_locker) { if (SubscriberKit != null) { SubscriberKit.SubscribeToAudio = false; SubscriberKit.SubscribeToVideo = false; SubscriberKit.Connected -= OnSubscriberConnected; SubscriberKit.StreamDisconnected -= OnSubscriberDisconnected; SubscriberKit.SubscriberDisconnected -= OnSubscriberDisconnected; SubscriberKit.VideoDisabled -= OnSubscriberVideoDisabled; SubscriberKit.VideoEnabled -= OnSubscriberVideoEnabled; SubscriberKit.Dispose(); SubscriberKit = null; } if (PublisherKit != null) { PublisherKit.PublishAudio = false; PublisherKit.PublishVideo = false; PublisherKit.StreamCreated -= OnPublisherStreamCreated; PublisherKit.Dispose(); PublisherKit = null; } if (Session != null) { Session.ConnectionDestroyed -= OnConnectionDestroyed; Session.Connected -= OnDidConnect; Session.StreamReceived -= OnStreamCreated; Session.StreamDropped -= OnStreamDestroyed; Session.Error -= OnError; Session.Signal -= OnSignal; Session.Disconnect(); Session.Dispose(); Session = null; } } ClearPublisherUpdated(); ClearSubscribeUpdated(); _medicalVideoCall.VideoCallStatusAsync((int)CallStatus.Ending, null, sendBackToRoot, showEvaluateCall); } finally { InvitedConnection = null; _medicalVideoCall.Messages.Clear(); IsSessionStarted = false; IsPublishingStarted = false; } }
public override void onStreamDestroyed(PublisherKit publisher, Stream stream) { if ((OpenTokConfig.SUBSCRIBE_TO_SELF && mSubscriber != null)) { unsubscribeFromStream(stream); screenshotWidget.Visibility = View.GONE; } }
public void OnStreamCreated(PublisherKit p0, Com.Opentok.Android.Stream p1) { this._streams.Add(p1); //if (this._subscriber == null) //{ // SubscribeToStream(p1); //} }
public void OnConnected(Session p0) { mPublisher = new Publisher.Builder(this).Build(); mPublisher.SetPublisherListener(this); mPublisherViewContainer.AddView(mPublisher.View); mSession.Publish(mPublisher); }
public void OnStreamCreated(PublisherKit p0, Stream p1) { _streams.Add(p1); if (_subscriber == null) { SubscribeToStream(p1); } }
public override void EndSession() { try { if (Session == null) { return; } lock (_locker) { if (Subscribers?.Count > 0) { foreach (OTSubscriber subscriberKit in Subscribers.Select(subscriber => subscriber.Value)) { subscriberKit.SubscribeToAudio = false; subscriberKit.SubscribeToVideo = false; subscriberKit.DidConnectToStream -= OnSubscriberConnected; subscriberKit.DidDisconnectFromStream -= OnSubscriberDisconnected; subscriberKit.VideoDataReceived -= OnSubscriberVideoDataReceived; subscriberKit.VideoEnabled -= OnSubscriberVideoEnabled; subscriberKit.VideoDisabled -= OnSubscriberVideoDisabled; subscriberKit.Dispose(); } Subscribers = new Dictionary <string, OTSubscriber>(); } if (PublisherKit != null) { PublisherKit.PublishAudio = false; PublisherKit.PublishVideo = false; PublisherKit.StreamCreated -= OnPublisherStreamCreated; PublisherKit.Dispose(); PublisherKit = null; } if (Session != null) { Session.ConnectionDestroyed -= OnConnectionDestroyed; Session.DidConnect -= OnDidConnect; Session.StreamCreated -= OnStreamCreated; Session.StreamDestroyed -= OnStreamDestroyed; Session.DidFailWithError -= OnError; Session.ReceivedSignalType -= OnSignalReceived; Session.Disconnect(); Session.Dispose(); Session = null; } } } finally { IsSessionStarted = false; IsPublishingStarted = false; } }
public override void onStreamCreated(PublisherKit publisher, Stream stream) { if (OpenTokConfig.SUBSCRIBE_TO_SELF) { mStreams.Add(stream); if (mSubscriber == null) { subscribeToStream(stream); } } }
public override void EndSession() { lock (_sessionLocker) { try { if (Session == null) { return; } foreach (var subscriberKit in _subscribers) { ClearSubscriber(subscriberKit); } _subscribers.Clear(); _subscriberStreamIds.Clear(); if (PublisherKit != null) { using (PublisherKit) { PublisherKit.PublishAudio = false; PublisherKit.PublishVideo = false; PublisherKit.StreamCreated -= OnPublisherStreamCreated; } PublisherKit = null; } RaisePublisherUpdated(). RaiseSubscriberUpdated(); if (Session != null) { using (Session) { Session.ConnectionDestroyed -= OnConnectionDestroyed; Session.Connected -= OnConnected; Session.StreamReceived -= OnStreamReceived; Session.StreamDropped -= OnStreamDropped; Session.Error -= OnError; Session.Signal -= OnSignal; Session.Disconnect(); } Session = null; } } finally { IsSessionStarted = false; IsPublishingStarted = false; } } }
public override void EndSession() { try { if (Session == null) { return; } lock (_locker) { if (SubscriberKit != null) { SubscriberKit.SubscribeToAudio = false; SubscriberKit.SubscribeToVideo = false; SubscriberKit.DidConnectToStream -= OnSubscriberDidConnectToStream; SubscriberKit.VideoDataReceived -= OnSubscriberVideoDataReceived; SubscriberKit.VideoEnabled -= OnSubscriberVideoEnabled; SubscriberKit.VideoDisabled -= OnSubscriberVideoDisabled; SubscriberKit.Dispose(); SubscriberKit = null; } if (PublisherKit != null) { PublisherKit.PublishAudio = false; PublisherKit.PublishVideo = false; PublisherKit.StreamCreated -= OnPublisherStreamCreated; PublisherKit.Dispose(); PublisherKit = null; } if (Session != null) { Session.ConnectionDestroyed -= OnConnectionDestroyed; Session.DidConnect -= OnDidConnect; Session.StreamCreated -= OnStreamCreated; Session.StreamDestroyed -= OnStreamDestroyed; Session.DidFailWithError -= OnError; Session.ReceivedSignalType -= OnSignalReceived; Session.Disconnect(); Session.Dispose(); Session = null; } } } finally { IsSessionStarted = false; IsPublishingStarted = false; } }
public override void onStreamCreated(PublisherKit publisher, Stream stream) { if (OpenTokConfig.SUBSCRIBE_TO_SELF) { mStreams.Add(stream); if (mSubscriber == null) { subscribeToStream(stream); } } mPublisherFragment.showPublisherWidget(true); mPublisherFragment.initPublisherUI(); mPublisherStatusFragment.showPubStatusWidget(true); mPublisherStatusFragment.initPubStatusUI(); }
private void ClearPublisher() { if (PublisherKit == null) { return; } using (PublisherKit) { PublisherKit.PublishAudio = false; PublisherKit.PublishVideo = false; PublisherKit.StreamCreated -= OnPublisherStreamCreated; Session.Unpublish(PublisherKit); } PublisherKit = null; }
private void OnConnected(object sender, Session.ConnectedEventArgs e) { if (Session == null || PublisherKit != null) { return; } using (var builder = new Publisher.Builder(CrossCurrentActivity.Current.AppContext).Name("XamarinOpenTok")) { PublisherKit = builder.Build(); PublisherKit.PublishVideo = IsVideoPublishingEnabled; PublisherKit.PublishAudio = IsAudioPublishingEnabled; PublisherKit.SetStyle(BaseVideoRenderer.StyleVideoScale, BaseVideoRenderer.StyleVideoFill); PublisherKit.StreamCreated += OnPublisherStreamCreated; Session.Publish(PublisherKit); RaisePublisherUpdated(); } }
public void OnStreamDestroyed(PublisherKit publisher, Stream stream) { UnsubscribeFromStream (stream); }
public void OnStreamDestroyed(PublisherKit p0, Stream p1) { if ((_subscriber != null)) { UnsubscribeFromStream (p1); } }
public void OnError(PublisherKit publisher, OpentokError exception) { // error }
public override void onAudioLevelUpdated(PublisherKit publisher, float audioLevel) { meterView.MeterValue = audioLevel; }
public void OnError(PublisherKit p0, OpentokError p1) { }
public override void onError(PublisherKit publisher, OpentokError exception) { Log.i(LOGTAG, "Publisher exception: " + exception.Message); }
public void OnError(PublisherKit publisher, OpentokError exception) { // TODO: handle error }
private void SetVideoScaleStyle(PublisherKit publisherKit) => publisherKit.SetStyle(BaseVideoRenderer.StyleVideoScale, MapVideoScaleStyle(PublisherVideoScaleStyle));
public void OnError(PublisherKit p0, OpentokError p1) { //throw new NotImplementedException(); }
public override void onStreamDestroyed(PublisherKit publisher, Stream stream) { if ((OpenTokConfig.SUBSCRIBE_TO_SELF && mSubscriber != null)) { unsubscribeFromStream(stream); } }
public void OnStreamDestroyed(PublisherKit p0, Stream p1) { //throw new NotImplementedException(); }
public void OnStreamDestroyed(PublisherKit publisher, Stream stream) { UnsubscribeFromStream(stream); }