@azure/communication-react 1.3.3-alpha-202210280017.0 → 1.3.3-alpha-202210290014.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -501,7 +501,7 @@ export declare interface CallAdapter extends AdapterState<CallAdapterState>, Dis
501
501
  * @public
502
502
  */
503
503
  export declare type CallAdapterCallEndedEvent = {
504
- callId?: string;
504
+ callId: string;
505
505
  };
506
506
 
507
507
  /**
@@ -202,7 +202,7 @@ const _toCommunicationIdentifier = (id) => {
202
202
  // Copyright (c) Microsoft Corporation.
203
203
  // Licensed under the MIT license.
204
204
  // GENERATED FILE. DO NOT EDIT MANUALLY.
205
- var telemetryVersion = '1.3.3-alpha-202210280017.0';
205
+ var telemetryVersion = '1.3.3-alpha-202210290014.0';
206
206
 
207
207
  // Copyright (c) Microsoft Corporation.
208
208
  /**
@@ -607,6 +607,29 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
607
607
  }
608
608
  });
609
609
  const onToggleCamera = (options) => __awaiter$v(void 0, void 0, void 0, function* () {
610
+ const previewOn = _isPreviewOn(callClient.getState().deviceManager);
611
+ if (previewOn && call && call.state === 'Connecting') {
612
+ // This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
613
+ // The root cause of the issue is caused by never transitioning the unparented view to the
614
+ // call object when going from configuration page (disconnected call state) to connecting.
615
+ //
616
+ // Currently the only time the local video stream is moved from unparented view to the call
617
+ // object is when we transition from connecting -> call state. If the camera was on,
618
+ // inside the MediaGallery we trigger toggleCamera. This triggers onStartLocalVideo which
619
+ // destroys the unparentedView and creates a new stream in the call - so all looks well.
620
+ //
621
+ // However, if someone turns off their camera during the lobbyOrConnecting screen, the
622
+ // call.localVideoStreams will be empty (as the stream is currently stored in the unparented
623
+ // views and was never transitioned to the call object) and thus we incorrectly try to create
624
+ // a new video stream for the call object, instead of only stopping the unparented view.
625
+ //
626
+ // The correct fix for this is to ensure that callAgent.onStartCall is called with the
627
+ // localvideostream as a videoOption. That will mean call.onLocalVideoStreamsUpdated will
628
+ // be triggered when the call is in connecting state, which we can then transition the
629
+ // local video stream to the stateful call client and get into a clean state.
630
+ yield onDisposeLocalStreamView();
631
+ return;
632
+ }
610
633
  if (call && (_isInCall(call.state) || _isInLobbyOrConnecting(call.state))) {
611
634
  const stream = call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');
612
635
  if (stream) {
@@ -619,7 +642,6 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
619
642
  else {
620
643
  const selectedCamera = callClient.getState().deviceManager.selectedCamera;
621
644
  if (selectedCamera) {
622
- const previewOn = _isPreviewOn(callClient.getState().deviceManager);
623
645
  if (previewOn) {
624
646
  yield onDisposeLocalStreamView();
625
647
  }