зеркало из
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}. * Proxy of {@link @azure/communication-calling#TogetherModeCallFeature.togetherModeStream}.
*/ */
stream?: TogetherModeStreamState; stream: TogetherModeStreamState[];
} }
/* @conditional-compile-remove(together-mode) */ /* @conditional-compile-remove(together-mode) */

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

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

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

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

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

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

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

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

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

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

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

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

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

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