@webex/plugin-meetings 2.59.6-next.1 → 2.59.6-next.2
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.
- package/dist/meeting/index.js +148 -119
- package/dist/meeting/index.js.map +1 -1
- package/package.json +2 -2
- package/src/meeting/index.ts +23 -12
- package/test/unit/spec/meeting/index.js +47 -6
package/package.json
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@webex/eslint-config-legacy": "^0.0.0",
|
|
44
44
|
"@webex/jest-config-legacy": "^0.0.0",
|
|
45
45
|
"@webex/legacy-tools": "^0.0.0",
|
|
46
|
-
"@webex/plugin-meetings": "^2.59.6-next.
|
|
46
|
+
"@webex/plugin-meetings": "^2.59.6-next.2",
|
|
47
47
|
"@webex/plugin-rooms": "^2.59.4-next.1",
|
|
48
48
|
"@webex/test-helper-chai": "^2.59.4-next.1",
|
|
49
49
|
"@webex/test-helper-mocha": "^2.59.4-next.1",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"uuid": "^3.3.2",
|
|
81
81
|
"webrtc-adapter": "^7.7.0"
|
|
82
82
|
},
|
|
83
|
-
"version": "2.59.6-next.
|
|
83
|
+
"version": "2.59.6-next.2"
|
|
84
84
|
}
|
package/src/meeting/index.ts
CHANGED
|
@@ -462,6 +462,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
462
462
|
shareStatus: string;
|
|
463
463
|
statsAnalyzer: StatsAnalyzer;
|
|
464
464
|
transcription: Transcription;
|
|
465
|
+
receiveTranscription: boolean;
|
|
465
466
|
updateMediaConnections: (mediaConnections: any[]) => void;
|
|
466
467
|
endCallInitiateJoinReq: any;
|
|
467
468
|
endJoinReqResp: any;
|
|
@@ -1761,8 +1762,8 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1761
1762
|
LOCUSINFO.EVENTS.CONTROLS_MEETING_TRANSCRIBE_UPDATED,
|
|
1762
1763
|
({caption, transcribing}) => {
|
|
1763
1764
|
// @ts-ignore - config coming from registerPlugin
|
|
1764
|
-
if (transcribing && this.transcription && this.config.receiveTranscription) {
|
|
1765
|
-
this.
|
|
1765
|
+
if (transcribing && !this.transcription && this.config.receiveTranscription) {
|
|
1766
|
+
this.startTranscription();
|
|
1766
1767
|
} else if (!transcribing && this.transcription) {
|
|
1767
1768
|
Trigger.trigger(
|
|
1768
1769
|
this,
|
|
@@ -2261,8 +2262,17 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
2261
2262
|
});
|
|
2262
2263
|
}
|
|
2263
2264
|
});
|
|
2264
|
-
this.locusInfo.on(LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, (payload) => {
|
|
2265
|
+
this.locusInfo.on(LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, async (payload) => {
|
|
2265
2266
|
this.stopKeepAlive();
|
|
2267
|
+
// @ts-ignore
|
|
2268
|
+
if (!this.transcription && (this.config.receiveTranscription || this.receiveTranscription)) {
|
|
2269
|
+
if (this.isTranscriptionSupported()) {
|
|
2270
|
+
await this.startTranscription();
|
|
2271
|
+
LoggerProxy.logger.info(
|
|
2272
|
+
'Meeting:index#setUpLocusInfoSelfListener --> enabled to receive transcription for guest user!'
|
|
2273
|
+
);
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2266
2276
|
|
|
2267
2277
|
if (payload) {
|
|
2268
2278
|
Trigger.trigger(
|
|
@@ -3725,9 +3735,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3725
3735
|
* @private
|
|
3726
3736
|
* @returns {Promise<void>} a promise to open the WebSocket connection
|
|
3727
3737
|
*/
|
|
3728
|
-
private async
|
|
3738
|
+
private async startTranscription() {
|
|
3729
3739
|
LoggerProxy.logger.info(
|
|
3730
|
-
`Meeting:index#
|
|
3740
|
+
`Meeting:index#startTranscription -->
|
|
3731
3741
|
Attempting to generate a web socket url.`
|
|
3732
3742
|
);
|
|
3733
3743
|
|
|
@@ -3744,7 +3754,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3744
3754
|
});
|
|
3745
3755
|
|
|
3746
3756
|
LoggerProxy.logger.info(
|
|
3747
|
-
`Meeting:index#
|
|
3757
|
+
`Meeting:index#startTranscription -->
|
|
3748
3758
|
Generated web socket url succesfully.`
|
|
3749
3759
|
);
|
|
3750
3760
|
|
|
@@ -3756,7 +3766,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3756
3766
|
);
|
|
3757
3767
|
|
|
3758
3768
|
LoggerProxy.logger.info(
|
|
3759
|
-
`Meeting:index#
|
|
3769
|
+
`Meeting:index#startTranscription -->
|
|
3760
3770
|
opened LLM web socket connection successfully.`
|
|
3761
3771
|
);
|
|
3762
3772
|
|
|
@@ -3777,7 +3787,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3777
3787
|
// @ts-ignore - fix type
|
|
3778
3788
|
this.transcription.connect(this.webex.credentials.supertoken.access_token);
|
|
3779
3789
|
} catch (error) {
|
|
3780
|
-
LoggerProxy.logger.error(`Meeting:index#
|
|
3790
|
+
LoggerProxy.logger.error(`Meeting:index#startTranscription --> ${error}`);
|
|
3781
3791
|
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.RECEIVE_TRANSCRIPTION_FAILURE, {
|
|
3782
3792
|
correlation_id: this.correlationId,
|
|
3783
3793
|
reason: error.message,
|
|
@@ -3950,6 +3960,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3950
3960
|
.then((join) => {
|
|
3951
3961
|
joinSuccess(join);
|
|
3952
3962
|
this.deferJoin = undefined;
|
|
3963
|
+
this.receiveTranscription = !!options.receiveTranscription;
|
|
3953
3964
|
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.JOIN_SUCCESS, {
|
|
3954
3965
|
correlation_id: this.correlationId,
|
|
3955
3966
|
});
|
|
@@ -3959,10 +3970,10 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3959
3970
|
.then(async (join) => {
|
|
3960
3971
|
if (isBrowser) {
|
|
3961
3972
|
// @ts-ignore - config coming from registerPlugin
|
|
3962
|
-
if (this.config.receiveTranscription ||
|
|
3973
|
+
if (this.config.receiveTranscription || this.receiveTranscription) {
|
|
3963
3974
|
if (this.isTranscriptionSupported()) {
|
|
3964
|
-
await this.
|
|
3965
|
-
LoggerProxy.logger.info('Meeting:index#join --> enabled to
|
|
3975
|
+
await this.startTranscription();
|
|
3976
|
+
LoggerProxy.logger.info('Meeting:index#join --> enabled to receive transcription!');
|
|
3966
3977
|
}
|
|
3967
3978
|
}
|
|
3968
3979
|
} else {
|
|
@@ -5698,7 +5709,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
5698
5709
|
if (layoutType) {
|
|
5699
5710
|
if (!LAYOUT_TYPES.includes(layoutType)) {
|
|
5700
5711
|
return this.rejectWithErrorLog(
|
|
5701
|
-
'Meeting:index#changeVideoLayout --> cannot change video layout, invalid layoutType
|
|
5712
|
+
'Meeting:index#changeVideoLayout --> cannot change video layout, invalid layoutType received.'
|
|
5702
5713
|
);
|
|
5703
5714
|
}
|
|
5704
5715
|
|
|
@@ -770,12 +770,12 @@ describe('plugin-meetings', () => {
|
|
|
770
770
|
assert.equal(meeting.isTranscriptionSupported(), true);
|
|
771
771
|
});
|
|
772
772
|
});
|
|
773
|
-
describe('#
|
|
773
|
+
describe('#startTranscription', () => {
|
|
774
774
|
it('should invoke subscribe method to invoke the callback', () => {
|
|
775
775
|
meeting.monitorTranscriptionSocketConnection = sinon.stub();
|
|
776
776
|
meeting.initializeTranscription = sinon.stub();
|
|
777
777
|
|
|
778
|
-
meeting.
|
|
778
|
+
meeting.startTranscription().then(() => {
|
|
779
779
|
assert.equal(true, false);
|
|
780
780
|
assert.calledOnce(meeting.initializeTranscription);
|
|
781
781
|
assert.calledOnce(meeting.monitorTranscriptionSocketConnection);
|
|
@@ -786,7 +786,7 @@ describe('plugin-meetings', () => {
|
|
|
786
786
|
meeting.request = sinon.stub().returns(Promise.reject());
|
|
787
787
|
|
|
788
788
|
try {
|
|
789
|
-
await meeting.
|
|
789
|
+
await meeting.startTranscription();
|
|
790
790
|
} catch (err) {
|
|
791
791
|
assert(err, {});
|
|
792
792
|
}
|
|
@@ -840,12 +840,12 @@ describe('plugin-meetings', () => {
|
|
|
840
840
|
assert.calledOnce(MeetingUtil.joinMeeting);
|
|
841
841
|
assert.calledOnce(meeting.setLocus);
|
|
842
842
|
});
|
|
843
|
-
it('should invoke `
|
|
843
|
+
it('should invoke `startTranscription()` if receiveTranscription is set to true', async () => {
|
|
844
844
|
meeting.isTranscriptionSupported = sinon.stub().returns(true);
|
|
845
|
-
meeting.
|
|
845
|
+
meeting.startTranscription = sinon.stub().returns(Promise.resolve());
|
|
846
846
|
|
|
847
847
|
await meeting.join({receiveTranscription: true});
|
|
848
|
-
assert.calledOnce(meeting.
|
|
848
|
+
assert.calledOnce(meeting.startTranscription);
|
|
849
849
|
});
|
|
850
850
|
|
|
851
851
|
it('should not create new correlation ID on join immediately after create', async () => {
|
|
@@ -3578,8 +3578,49 @@ describe('plugin-meetings', () => {
|
|
|
3578
3578
|
);
|
|
3579
3579
|
done();
|
|
3580
3580
|
});
|
|
3581
|
+
it('transcription should start when configured when guest admitted', (done) => {
|
|
3582
|
+
meeting.isTranscriptionSupported = sinon.stub().returns(true);
|
|
3583
|
+
meeting.receiveTranscription = sinon.stub().returns(true);
|
|
3584
|
+
meeting.startTranscription = sinon.stub();
|
|
3585
|
+
|
|
3586
|
+
meeting.locusInfo.emit({function: 'test', file: 'test'}, 'SELF_ADMITTED_GUEST', test1);
|
|
3587
|
+
assert.calledOnce(meeting.startTranscription);
|
|
3588
|
+
done();
|
|
3589
|
+
});
|
|
3581
3590
|
});
|
|
3582
3591
|
|
|
3592
|
+
describe('#setupLocusControlsListener', () => {
|
|
3593
|
+
it('transcription should start when meeting transcribe state is updated with active transcribing', (done) => {
|
|
3594
|
+
const payload = {caption: true, transcribing: true};
|
|
3595
|
+
meeting.startTranscription = sinon.stub();
|
|
3596
|
+
meeting.config.receiveTranscription = true;
|
|
3597
|
+
meeting.transcription = null;
|
|
3598
|
+
|
|
3599
|
+
meeting.locusInfo.emit({function: 'meeting/index', file: 'setupLocusControlsListener'}, 'CONTROLS_MEETING_TRANSCRIBE_UPDATED', payload);
|
|
3600
|
+
assert.calledOnce(meeting.startTranscription);
|
|
3601
|
+
done();
|
|
3602
|
+
})
|
|
3603
|
+
|
|
3604
|
+
it('transcription should stop when meeting transcribe state is updated with inactive transcribing', (done) => {
|
|
3605
|
+
const payload = {caption: false, transcribing: false};
|
|
3606
|
+
meeting.startTranscription = sinon.stub();
|
|
3607
|
+
meeting.config.receiveTranscription = true;
|
|
3608
|
+
meeting.transcription = {};
|
|
3609
|
+
|
|
3610
|
+
meeting.locusInfo.emit({function: 'meeting/index', file: 'setupLocusControlsListener'}, 'CONTROLS_MEETING_TRANSCRIBE_UPDATED', payload);
|
|
3611
|
+
assert.notCalled(meeting.startTranscription);
|
|
3612
|
+
assert.calledTwice(TriggerProxy.trigger);
|
|
3613
|
+
assert.calledWith(
|
|
3614
|
+
TriggerProxy.trigger,
|
|
3615
|
+
sinon.match.instanceOf(Meeting),
|
|
3616
|
+
{file: 'meeting/index', function: 'setupLocusControlsListener'},
|
|
3617
|
+
'meeting:receiveTranscription:stopped',
|
|
3618
|
+
payload
|
|
3619
|
+
);
|
|
3620
|
+
done();
|
|
3621
|
+
})
|
|
3622
|
+
})
|
|
3623
|
+
|
|
3583
3624
|
describe('#setUpLocusUrlListener', () => {
|
|
3584
3625
|
it('listens to the locus url update event', (done) => {
|
|
3585
3626
|
const newLocusUrl = 'newLocusUrl/12345';
|