зеркало из
1
0
Форкнуть 0
This commit is contained in:
Chukwuebuka Nwankwo 2024-09-12 19:23:59 +00:00
Родитель 6f8ce57950
Коммит 7945ca606f
9 изменённых файлов: 24 добавлений и 16 удалений

Просмотреть файл

@ -0,0 +1,9 @@
{
"type": "prerelease",
"area": "feature",
"workstream": "Together Mode",
"comment": "This PR contains implementation of together mode client state changes and the event listener for together mode stream updates",
"packageName": "@azure/communication-react",
"email": "nwankwojustin93@gmail.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -284,7 +284,7 @@ export interface TogetherModeCallFeatureState {
/**
* Proxy of {@link @azure/communication-calling#TogetherModeCallFeature.togetherModeStream}.
*/
stream?: TogetherModeStreamState;
stream: TogetherModeStreamState[];
}
/* @conditional-compile-remove(together-mode) */

Просмотреть файл

@ -8,7 +8,6 @@ import {
DominantSpeakersInfo,
ParticipantRole,
ScalingMode,
TogetherModeVideoStream,
VideoDeviceInfo
} from '@azure/communication-calling';
import { RaisedHand } from '@azure/communication-calling';
@ -26,6 +25,8 @@ import { TeamsCaptionsInfo } from '@azure/communication-calling';
import { CaptionsKind, CaptionsInfo as AcsCaptionsInfo } from '@azure/communication-calling';
/* @conditional-compile-remove(unsupported-browser) */
import { EnvironmentInfo } from '@azure/communication-calling';
/* @conditional-compile-remove(together-mode) */
import { TogetherModeVideoStream } from '@azure/communication-calling';
import { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';
import { EventEmitter } from 'events';
import { enableMapSet, enablePatches, Patch, produce } from 'immer';
@ -456,7 +457,7 @@ export class CallContext {
}
/* @conditional-compile-remove(together-mode) */
public setTogetherModeVideoStream(callId: string, addedStream: TogetherModeVideoStream): void {
public setTogetherModeVideoStream(callId: string, addedStream: TogetherModeVideoStream[]): void {
this.modifyState((draft: CallClientState) => {
const call = draft.calls[this._callIdHistory.latestCallId(callId)];
if (call) {
@ -466,13 +467,11 @@ export class CallContext {
}
/* @conditional-compile-remove(together-mode) */
public removeTogetherModeVideoStream(callId: string, removedStream: TogetherModeVideoStream): void {
public removeTogetherModeVideoStream(callId: string, removedStream: TogetherModeVideoStream[]): void {
this.modifyState((draft: CallClientState) => {
const call = draft.calls[this._callIdHistory.latestCallId(callId)];
if (call) {
if (call.togetherMode.stream && call.togetherMode.stream?.id === removedStream.id) {
call.togetherMode = { stream: undefined };
}
call.togetherMode = { stream: [] };
}
});
}

Просмотреть файл

@ -163,7 +163,7 @@ export function convertSdkCallToDeclarativeCall(call: CallCommon): CallState {
pptLive: { isActive: false },
raiseHand: { raisedHands: [] },
/* @conditional-compile-remove(together-mode) */
togetherMode: { stream: undefined },
togetherMode: { stream: [] },
localParticipantReaction: undefined,
transcription: { isTranscriptionActive: false },
screenShareRemoteParticipant: undefined,

Просмотреть файл

@ -90,7 +90,7 @@ function createMockCall(mockCallId: string): CallState {
localRecording: { isLocalRecordingActive: false },
raiseHand: { raisedHands: [] },
/* @conditional-compile-remove(together-mode) */
togetherMode: { stream: undefined },
togetherMode: { stream: [] },
localParticipantReaction: undefined,
transcription: { isTranscriptionActive: false },
screenShareRemoteParticipant: undefined,

Просмотреть файл

@ -32,11 +32,11 @@ export class TogetherModeSubscriber {
added: TogetherModeVideoStream[];
removed: TogetherModeVideoStream[];
}): void => {
for (const addedTogetherModeStream of args.added) {
this._context.setTogetherModeVideoStream(this._callIdRef.callId, addedTogetherModeStream);
if (args.added) {
this._context.setTogetherModeVideoStream(this._callIdRef.callId, args.added);
}
for (const removedTogetherModeStream of args.removed) {
this._context.removeTogetherModeVideoStream(this._callIdRef.callId, removedTogetherModeStream);
if (args.removed) {
this._context.removeTogetherModeVideoStream(this._callIdRef.callId, args.removed);
}
};
}

Просмотреть файл

@ -4865,7 +4865,7 @@ export const toFlatCommunicationIdentifier: (identifier: CommunicationIdentifier
// @alpha
export interface TogetherModeCallFeature {
stream?: TogetherModeStreamState;
stream: TogetherModeStreamState[];
}
// @alpha

Просмотреть файл

@ -261,7 +261,7 @@ const createDefaultCallAdapterState = (role?: ParticipantRole): CallAdapterState
remoteParticipantsEnded: {},
raiseHand: { raisedHands: [] },
/* @conditional-compile-remove(together-mode) */
togetherMode: { stream: undefined },
togetherMode: { stream: [] },
pptLive: { isActive: false },
localParticipantReaction: undefined,
role,

Просмотреть файл

@ -244,7 +244,7 @@ function createMockCall(mockCallId: string): CallState {
dominantSpeakers: undefined,
raiseHand: { raisedHands: [] },
/* @conditional-compile-remove(together-mode) */
togetherMode: { stream: undefined },
togetherMode: { stream: [] },
pptLive: { isActive: false },
localParticipantReaction: undefined,
captionsFeature: {