@tencentcloud/tuiroom-engine-electron 2.4.0-alpha.2 → 2.4.0-alpha.4

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.
@@ -1,568 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var TRTCDeviceManagerPlugin = require('trtc-electron-sdk/liteav/plugins/device-manager-plugin');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var TRTCDeviceManagerPlugin__default = /*#__PURE__*/_interopDefaultLegacy(TRTCDeviceManagerPlugin);
10
-
11
- /******************************************************************************
12
- Copyright (c) Microsoft Corporation.
13
-
14
- Permission to use, copy, modify, and/or distribute this software for any
15
- purpose with or without fee is hereby granted.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
- PERFORMANCE OF THIS SOFTWARE.
24
- ***************************************************************************** */
25
-
26
- function __awaiter(thisArg, _arguments, P, generator) {
27
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
- return new (P || (P = Promise))(function (resolve, reject) {
29
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33
- });
34
- }
35
-
36
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
37
- var e = new Error(message);
38
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
39
- };
40
-
41
- var eventemitter3 = {exports: {}};
42
-
43
- (function (module) {
44
-
45
- var has = Object.prototype.hasOwnProperty
46
- , prefix = '~';
47
-
48
- /**
49
- * Constructor to create a storage for our `EE` objects.
50
- * An `Events` instance is a plain object whose properties are event names.
51
- *
52
- * @constructor
53
- * @private
54
- */
55
- function Events() {}
56
-
57
- //
58
- // We try to not inherit from `Object.prototype`. In some engines creating an
59
- // instance in this way is faster than calling `Object.create(null)` directly.
60
- // If `Object.create(null)` is not supported we prefix the event names with a
61
- // character to make sure that the built-in object properties are not
62
- // overridden or used as an attack vector.
63
- //
64
- if (Object.create) {
65
- Events.prototype = Object.create(null);
66
-
67
- //
68
- // This hack is needed because the `__proto__` property is still inherited in
69
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
70
- //
71
- if (!new Events().__proto__) prefix = false;
72
- }
73
-
74
- /**
75
- * Representation of a single event listener.
76
- *
77
- * @param {Function} fn The listener function.
78
- * @param {*} context The context to invoke the listener with.
79
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
80
- * @constructor
81
- * @private
82
- */
83
- function EE(fn, context, once) {
84
- this.fn = fn;
85
- this.context = context;
86
- this.once = once || false;
87
- }
88
-
89
- /**
90
- * Add a listener for a given event.
91
- *
92
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
93
- * @param {(String|Symbol)} event The event name.
94
- * @param {Function} fn The listener function.
95
- * @param {*} context The context to invoke the listener with.
96
- * @param {Boolean} once Specify if the listener is a one-time listener.
97
- * @returns {EventEmitter}
98
- * @private
99
- */
100
- function addListener(emitter, event, fn, context, once) {
101
- if (typeof fn !== 'function') {
102
- throw new TypeError('The listener must be a function');
103
- }
104
-
105
- var listener = new EE(fn, context || emitter, once)
106
- , evt = prefix ? prefix + event : event;
107
-
108
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
109
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
110
- else emitter._events[evt] = [emitter._events[evt], listener];
111
-
112
- return emitter;
113
- }
114
-
115
- /**
116
- * Clear event by name.
117
- *
118
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
119
- * @param {(String|Symbol)} evt The Event name.
120
- * @private
121
- */
122
- function clearEvent(emitter, evt) {
123
- if (--emitter._eventsCount === 0) emitter._events = new Events();
124
- else delete emitter._events[evt];
125
- }
126
-
127
- /**
128
- * Minimal `EventEmitter` interface that is molded against the Node.js
129
- * `EventEmitter` interface.
130
- *
131
- * @constructor
132
- * @public
133
- */
134
- function EventEmitter() {
135
- this._events = new Events();
136
- this._eventsCount = 0;
137
- }
138
-
139
- /**
140
- * Return an array listing the events for which the emitter has registered
141
- * listeners.
142
- *
143
- * @returns {Array}
144
- * @public
145
- */
146
- EventEmitter.prototype.eventNames = function eventNames() {
147
- var names = []
148
- , events
149
- , name;
150
-
151
- if (this._eventsCount === 0) return names;
152
-
153
- for (name in (events = this._events)) {
154
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
155
- }
156
-
157
- if (Object.getOwnPropertySymbols) {
158
- return names.concat(Object.getOwnPropertySymbols(events));
159
- }
160
-
161
- return names;
162
- };
163
-
164
- /**
165
- * Return the listeners registered for a given event.
166
- *
167
- * @param {(String|Symbol)} event The event name.
168
- * @returns {Array} The registered listeners.
169
- * @public
170
- */
171
- EventEmitter.prototype.listeners = function listeners(event) {
172
- var evt = prefix ? prefix + event : event
173
- , handlers = this._events[evt];
174
-
175
- if (!handlers) return [];
176
- if (handlers.fn) return [handlers.fn];
177
-
178
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
179
- ee[i] = handlers[i].fn;
180
- }
181
-
182
- return ee;
183
- };
184
-
185
- /**
186
- * Return the number of listeners listening to a given event.
187
- *
188
- * @param {(String|Symbol)} event The event name.
189
- * @returns {Number} The number of listeners.
190
- * @public
191
- */
192
- EventEmitter.prototype.listenerCount = function listenerCount(event) {
193
- var evt = prefix ? prefix + event : event
194
- , listeners = this._events[evt];
195
-
196
- if (!listeners) return 0;
197
- if (listeners.fn) return 1;
198
- return listeners.length;
199
- };
200
-
201
- /**
202
- * Calls each of the listeners registered for a given event.
203
- *
204
- * @param {(String|Symbol)} event The event name.
205
- * @returns {Boolean} `true` if the event had listeners, else `false`.
206
- * @public
207
- */
208
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
209
- var evt = prefix ? prefix + event : event;
210
-
211
- if (!this._events[evt]) return false;
212
-
213
- var listeners = this._events[evt]
214
- , len = arguments.length
215
- , args
216
- , i;
217
-
218
- if (listeners.fn) {
219
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
220
-
221
- switch (len) {
222
- case 1: return listeners.fn.call(listeners.context), true;
223
- case 2: return listeners.fn.call(listeners.context, a1), true;
224
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
225
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
226
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
227
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
228
- }
229
-
230
- for (i = 1, args = new Array(len -1); i < len; i++) {
231
- args[i - 1] = arguments[i];
232
- }
233
-
234
- listeners.fn.apply(listeners.context, args);
235
- } else {
236
- var length = listeners.length
237
- , j;
238
-
239
- for (i = 0; i < length; i++) {
240
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
241
-
242
- switch (len) {
243
- case 1: listeners[i].fn.call(listeners[i].context); break;
244
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
245
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
246
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
247
- default:
248
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
249
- args[j - 1] = arguments[j];
250
- }
251
-
252
- listeners[i].fn.apply(listeners[i].context, args);
253
- }
254
- }
255
- }
256
-
257
- return true;
258
- };
259
-
260
- /**
261
- * Add a listener for a given event.
262
- *
263
- * @param {(String|Symbol)} event The event name.
264
- * @param {Function} fn The listener function.
265
- * @param {*} [context=this] The context to invoke the listener with.
266
- * @returns {EventEmitter} `this`.
267
- * @public
268
- */
269
- EventEmitter.prototype.on = function on(event, fn, context) {
270
- return addListener(this, event, fn, context, false);
271
- };
272
-
273
- /**
274
- * Add a one-time listener for a given event.
275
- *
276
- * @param {(String|Symbol)} event The event name.
277
- * @param {Function} fn The listener function.
278
- * @param {*} [context=this] The context to invoke the listener with.
279
- * @returns {EventEmitter} `this`.
280
- * @public
281
- */
282
- EventEmitter.prototype.once = function once(event, fn, context) {
283
- return addListener(this, event, fn, context, true);
284
- };
285
-
286
- /**
287
- * Remove the listeners of a given event.
288
- *
289
- * @param {(String|Symbol)} event The event name.
290
- * @param {Function} fn Only remove the listeners that match this function.
291
- * @param {*} context Only remove the listeners that have this context.
292
- * @param {Boolean} once Only remove one-time listeners.
293
- * @returns {EventEmitter} `this`.
294
- * @public
295
- */
296
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
297
- var evt = prefix ? prefix + event : event;
298
-
299
- if (!this._events[evt]) return this;
300
- if (!fn) {
301
- clearEvent(this, evt);
302
- return this;
303
- }
304
-
305
- var listeners = this._events[evt];
306
-
307
- if (listeners.fn) {
308
- if (
309
- listeners.fn === fn &&
310
- (!once || listeners.once) &&
311
- (!context || listeners.context === context)
312
- ) {
313
- clearEvent(this, evt);
314
- }
315
- } else {
316
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
317
- if (
318
- listeners[i].fn !== fn ||
319
- (once && !listeners[i].once) ||
320
- (context && listeners[i].context !== context)
321
- ) {
322
- events.push(listeners[i]);
323
- }
324
- }
325
-
326
- //
327
- // Reset the array, or remove it completely if we have no more listeners.
328
- //
329
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
330
- else clearEvent(this, evt);
331
- }
332
-
333
- return this;
334
- };
335
-
336
- /**
337
- * Remove all listeners, or those of the specified event.
338
- *
339
- * @param {(String|Symbol)} [event] The event name.
340
- * @returns {EventEmitter} `this`.
341
- * @public
342
- */
343
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
344
- var evt;
345
-
346
- if (event) {
347
- evt = prefix ? prefix + event : event;
348
- if (this._events[evt]) clearEvent(this, evt);
349
- } else {
350
- this._events = new Events();
351
- this._eventsCount = 0;
352
- }
353
-
354
- return this;
355
- };
356
-
357
- //
358
- // Alias methods names because people roll like that.
359
- //
360
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
361
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
362
-
363
- //
364
- // Expose the prefix.
365
- //
366
- EventEmitter.prefixed = prefix;
367
-
368
- //
369
- // Allow `EventEmitter` to be imported as module namespace.
370
- //
371
- EventEmitter.EventEmitter = EventEmitter;
372
-
373
- //
374
- // Expose the module.
375
- //
376
- {
377
- module.exports = EventEmitter;
378
- }
379
- } (eventemitter3));
380
-
381
- var EventEmitter = eventemitter3.exports;
382
-
383
- exports.TUIDeviceType = void 0;
384
- (function (TUIDeviceType) {
385
- TUIDeviceType[TUIDeviceType["DeviceTypeUnknown"] = -1] = "DeviceTypeUnknown";
386
- TUIDeviceType[TUIDeviceType["DeviceTypeMic"] = 0] = "DeviceTypeMic";
387
- TUIDeviceType[TUIDeviceType["DeviceTypeSpeaker"] = 1] = "DeviceTypeSpeaker";
388
- TUIDeviceType[TUIDeviceType["DeviceTypeCamera"] = 2] = "DeviceTypeCamera";
389
- })(exports.TUIDeviceType || (exports.TUIDeviceType = {}));
390
- exports.TUICameraCaptureMode = void 0;
391
- (function (TUICameraCaptureMode) {
392
- TUICameraCaptureMode[TUICameraCaptureMode["CameraResolutionStrategyAuto"] = 0] = "CameraResolutionStrategyAuto";
393
- TUICameraCaptureMode[TUICameraCaptureMode["CameraResolutionStrategyPerformance"] = 1] = "CameraResolutionStrategyPerformance";
394
- TUICameraCaptureMode[TUICameraCaptureMode["CameraResolutionStrategyHighQuality"] = 2] = "CameraResolutionStrategyHighQuality";
395
- TUICameraCaptureMode[TUICameraCaptureMode["CameraCaptureManual"] = 3] = "CameraCaptureManual";
396
- })(exports.TUICameraCaptureMode || (exports.TUICameraCaptureMode = {}));
397
- exports.TUIDeviceState = void 0;
398
- (function (TUIDeviceState) {
399
- TUIDeviceState[TUIDeviceState["DeviceStateAdd"] = 0] = "DeviceStateAdd";
400
- TUIDeviceState[TUIDeviceState["DeviceStateRemove"] = 1] = "DeviceStateRemove";
401
- TUIDeviceState[TUIDeviceState["DeviceStateActive"] = 2] = "DeviceStateActive";
402
- TUIDeviceState[TUIDeviceState["DefaultDeviceChanged"] = 3] = "DefaultDeviceChanged";
403
- })(exports.TUIDeviceState || (exports.TUIDeviceState = {}));
404
- const logger = console;
405
- class TUIDeviceManagerPlugin {
406
- constructor() {
407
- this.eventEmitter = new EventEmitter();
408
- this.trtcDeviceManagerPlugin = new TRTCDeviceManagerPlugin__default["default"]();
409
- this.trtcDeviceManagerPlugin.on('onDeviceChanged', (deviceId, type, state) => {
410
- logger.debug('[TUIDeviceManagerPlugin]onDeviceChanged', deviceId, type, state);
411
- this.eventEmitter.emit('onDeviceChanged', deviceId, type, state);
412
- });
413
- }
414
- getCameraDevicesList() {
415
- return this.trtcDeviceManagerPlugin.getCameraDevicesList();
416
- }
417
- getMicDevicesList() {
418
- return this.trtcDeviceManagerPlugin.getMicDevicesList();
419
- }
420
- getSpeakerDevicesList() {
421
- return this.trtcDeviceManagerPlugin.getSpeakerDevicesList();
422
- }
423
- setCurrentDevice(type, deviceId) {
424
- return __awaiter(this, void 0, void 0, function* () {
425
- logger.debug('[TUIDeviceManagerPlugin]setCurrentDevice', type, deviceId);
426
- return yield this.trtcDeviceManagerPlugin.setCurrentDevice(type, deviceId);
427
- });
428
- }
429
- getCurrentDevice(type) {
430
- return __awaiter(this, void 0, void 0, function* () {
431
- logger.debug('[TUIDeviceManagerPlugin]getCurrentDevice', type);
432
- return yield this.trtcDeviceManagerPlugin.getCurrentDevice(type);
433
- });
434
- }
435
- setCurrentDeviceVolume(type, volume) {
436
- return __awaiter(this, void 0, void 0, function* () {
437
- logger.debug('[TUIDeviceManagerPlugin]setCurrentDeviceVolume', type, volume);
438
- return yield this.trtcDeviceManagerPlugin.setCurrentDeviceVolume(type, volume);
439
- });
440
- }
441
- getCurrentDeviceVolume(type) {
442
- return __awaiter(this, void 0, void 0, function* () {
443
- logger.debug('[TUIDeviceManagerPlugin]getCurrentDeviceVolume', type);
444
- return yield this.trtcDeviceManagerPlugin.getCurrentDeviceVolume(type);
445
- });
446
- }
447
- setCurrentDeviceMute(type, mute) {
448
- return __awaiter(this, void 0, void 0, function* () {
449
- logger.debug('[TUIDeviceManagerPlugin]setCurrentDeviceMute', type, mute);
450
- return yield this.trtcDeviceManagerPlugin.setCurrentDeviceMute(type, mute);
451
- });
452
- }
453
- getCurrentDeviceMute(type) {
454
- return __awaiter(this, void 0, void 0, function* () {
455
- logger.debug('[TUIDeviceManagerPlugin]getCurrentDeviceMute', type);
456
- return yield this.trtcDeviceManagerPlugin.getCurrentDeviceMute(type);
457
- });
458
- }
459
- enableFollowingDefaultAudioDevice(type, enable) {
460
- return __awaiter(this, void 0, void 0, function* () {
461
- logger.debug('[TUIDeviceManagerPlugin]enableFollowingDefaultAudioDevice', type, enable);
462
- // eslint-disable-next-line max-len
463
- return yield this.trtcDeviceManagerPlugin.enableFollowingDefaultAudioDevice(type, enable);
464
- });
465
- }
466
- startCameraDeviceTest(windowID, rect) {
467
- return __awaiter(this, void 0, void 0, function* () {
468
- let result = 0;
469
- for (let i = windowID.length - 1; i >= 0; i--) {
470
- result = (result * 256) + windowID[i];
471
- }
472
- logger.debug('[TUIDeviceManagerPlugin]startCameraDeviceTest', result, windowID, rect);
473
- return yield this.trtcDeviceManagerPlugin.startCameraDeviceTest(result, rect);
474
- });
475
- }
476
- stopCameraDeviceTest() {
477
- return __awaiter(this, void 0, void 0, function* () {
478
- logger.debug('[TUIDeviceManagerPlugin]stopCameraDeviceTest');
479
- return yield this.trtcDeviceManagerPlugin.stopCameraDeviceTest();
480
- });
481
- }
482
- startMicDeviceTest(interval, playback) {
483
- return __awaiter(this, void 0, void 0, function* () {
484
- logger.debug('[TUIDeviceManagerPlugin]startMicDeviceTest', interval, playback);
485
- if (playback !== undefined) {
486
- return yield this.trtcDeviceManagerPlugin.startMicDeviceTest(interval, playback);
487
- }
488
- return yield this.trtcDeviceManagerPlugin.startMicDeviceTest(interval);
489
- });
490
- }
491
- setCameraTestRenderMirror(mirror) {
492
- logger.debug('[TUIDeviceManagerPlugin]setCameraTestRenderMirror', mirror);
493
- this.trtcDeviceManagerPlugin.setCameraTestRenderMirror(mirror);
494
- }
495
- setCameraTestDeviceId(cameraId) {
496
- logger.debug('[TUIDeviceManagerPlugin]setCameraTestDeviceId');
497
- this.trtcDeviceManagerPlugin.setCameraTestDeviceId(cameraId);
498
- }
499
- setCameraTestResolution(width, height) {
500
- logger.debug('[TUIDeviceManagerPlugin]setCameraTestResolution');
501
- this.trtcDeviceManagerPlugin.setCameraTestResolution(width, height);
502
- }
503
- setCameraTestVideoPluginPath(path) {
504
- logger.debug('[TUIDeviceManagerPlugin]setCameraTestVideoPluginPath');
505
- this.trtcDeviceManagerPlugin.setCameraTestVideoPluginPath(path);
506
- }
507
- setCameraTestVideoPluginParameter(params) {
508
- logger.debug('[TUIDeviceManagerPlugin]setCameraTestVideoPluginParameter');
509
- this.trtcDeviceManagerPlugin.setCameraTestVideoPluginParameter(params);
510
- }
511
- stopMicDeviceTest() {
512
- return __awaiter(this, void 0, void 0, function* () {
513
- logger.debug('[TUIDeviceManagerPlugin]stopMicDeviceTest');
514
- return yield this.trtcDeviceManagerPlugin.stopMicDeviceTest();
515
- });
516
- }
517
- startSpeakerDeviceTest(filePath) {
518
- return __awaiter(this, void 0, void 0, function* () {
519
- logger.debug('[TUIDeviceManagerPlugin]startSpeakerDeviceTest', filePath);
520
- return yield this.trtcDeviceManagerPlugin.startSpeakerDeviceTest(filePath);
521
- });
522
- }
523
- stopSpeakerDeviceTest() {
524
- return __awaiter(this, void 0, void 0, function* () {
525
- logger.debug('[TUIDeviceManagerPlugin]stopSpeakerDeviceTest');
526
- return yield this.trtcDeviceManagerPlugin.stopSpeakerDeviceTest();
527
- });
528
- }
529
- setApplicationPlayVolume(volume) {
530
- return __awaiter(this, void 0, void 0, function* () {
531
- logger.debug('[TUIDeviceManagerPlugin]setApplicationPlayVolume', volume);
532
- return yield this.trtcDeviceManagerPlugin.setApplicationPlayVolume(volume);
533
- });
534
- }
535
- getApplicationPlayVolume() {
536
- return __awaiter(this, void 0, void 0, function* () {
537
- logger.debug('[TUIDeviceManagerPlugin]getApplicationPlayVolume');
538
- return yield this.trtcDeviceManagerPlugin.getApplicationPlayVolume();
539
- });
540
- }
541
- setApplicationMuteState(mute) {
542
- return __awaiter(this, void 0, void 0, function* () {
543
- logger.debug('[TUIDeviceManagerPlugin]setApplicationMuteState', mute);
544
- return yield this.trtcDeviceManagerPlugin.setApplicationMuteState(mute);
545
- });
546
- }
547
- getApplicationMuteState() {
548
- return __awaiter(this, void 0, void 0, function* () {
549
- logger.debug('[TUIDeviceManagerPlugin]getApplicationMuteState');
550
- return yield this.trtcDeviceManagerPlugin.getApplicationMuteState();
551
- });
552
- }
553
- setCameraCapturerParam(params) {
554
- return __awaiter(this, void 0, void 0, function* () {
555
- logger.debug('[TUIDeviceManagerPlugin]setCameraCapturerParam');
556
- return yield this.trtcDeviceManagerPlugin.setCameraCaptureParam(params);
557
- });
558
- }
559
- on(event, func, context) {
560
- this.eventEmitter.on(event, func, context || null);
561
- }
562
- off(event, func) {
563
- this.eventEmitter.off(event, func);
564
- }
565
- }
566
-
567
- exports.TUIDeviceManagerPlugin = TUIDeviceManagerPlugin;
568
- exports["default"] = TUIDeviceManagerPlugin;
@@ -1,69 +0,0 @@
1
- import { TRTCDeviceInfo } from 'trtc-electron-sdk';
2
- export declare enum TUIDeviceType {
3
- DeviceTypeUnknown = -1,
4
- DeviceTypeMic = 0,
5
- DeviceTypeSpeaker = 1,
6
- DeviceTypeCamera = 2
7
- }
8
- export type TUIDeviceInfo = {
9
- deviceId: string;
10
- deviceName: string;
11
- deviceProperties: Record<string, any>;
12
- };
13
- export declare enum TUICameraCaptureMode {
14
- CameraResolutionStrategyAuto = 0,
15
- CameraResolutionStrategyPerformance = 1,
16
- CameraResolutionStrategyHighQuality = 2,
17
- CameraCaptureManual = 3
18
- }
19
- export type TUICameraCaptureParams = {
20
- mode: TUICameraCaptureMode;
21
- width: number;
22
- height: number;
23
- };
24
- export type TUIRect = {
25
- left: number;
26
- top: number;
27
- right: number;
28
- bottom: number;
29
- };
30
- export declare enum TUIDeviceState {
31
- DeviceStateAdd = 0,
32
- DeviceStateRemove = 1,
33
- DeviceStateActive = 2,
34
- DefaultDeviceChanged = 3
35
- }
36
- export declare class TUIDeviceManagerPlugin {
37
- private trtcDeviceManagerPlugin;
38
- private eventEmitter;
39
- constructor();
40
- getCameraDevicesList(): Array<TRTCDeviceInfo>;
41
- getMicDevicesList(): Array<TRTCDeviceInfo>;
42
- getSpeakerDevicesList(): Array<TRTCDeviceInfo>;
43
- setCurrentDevice(type: TUIDeviceType, deviceId: string): Promise<number>;
44
- getCurrentDevice(type: TUIDeviceType): Promise<TRTCDeviceInfo>;
45
- setCurrentDeviceVolume(type: TUIDeviceType, volume: number): Promise<number>;
46
- getCurrentDeviceVolume(type: TUIDeviceType): Promise<number>;
47
- setCurrentDeviceMute(type: TUIDeviceType, mute: boolean): Promise<number>;
48
- getCurrentDeviceMute(type: TUIDeviceType): Promise<boolean>;
49
- enableFollowingDefaultAudioDevice(type: TUIDeviceType, enable: boolean): Promise<number>;
50
- startCameraDeviceTest(windowID: Uint8Array, rect: TUIRect): Promise<number>;
51
- stopCameraDeviceTest(): Promise<number>;
52
- startMicDeviceTest(interval: number, playback?: boolean): Promise<number>;
53
- setCameraTestRenderMirror(mirror: boolean): void;
54
- setCameraTestDeviceId(cameraId: string): void;
55
- setCameraTestResolution(width: number, height: number): void;
56
- setCameraTestVideoPluginPath(path: string): void;
57
- setCameraTestVideoPluginParameter(params: string): void;
58
- stopMicDeviceTest(): Promise<number>;
59
- startSpeakerDeviceTest(filePath: string): Promise<number>;
60
- stopSpeakerDeviceTest(): Promise<number>;
61
- setApplicationPlayVolume(volume: number): Promise<number>;
62
- getApplicationPlayVolume(): Promise<number>;
63
- setApplicationMuteState(mute: boolean): Promise<number>;
64
- getApplicationMuteState(): Promise<boolean>;
65
- setCameraCapturerParam(params: TUICameraCaptureParams): Promise<void>;
66
- on(event: string, func: (...args: any[]) => void, context?: any): void;
67
- off(event: string, func: (...args: any[]) => void): void;
68
- }
69
- export default TUIDeviceManagerPlugin;