@stormstreaming/stormstreamer 0.9.0-beta.4 ā 0.9.0-beta.6
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/amd/index.js +179 -71
- package/dist/cjs/index.js +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/iife/index.js +3 -3
- package/dist/types/StormStreamer.d.ts +2 -0
- package/dist/types/config/SettingsData.d.ts +2 -0
- package/dist/types/events/StormStreamerEvent.d.ts +9 -0
- package/dist/types/index.amd.d.ts +1 -0
- package/dist/types/index.cjs.d.ts +1 -0
- package/dist/types/index.esm.d.ts +1 -0
- package/dist/types/index.umd.d.ts +1 -0
- package/dist/types/playback/PlaybackController.d.ts +4 -0
- package/dist/types/playback/SoundMeter.d.ts +1 -2
- package/dist/types/playback/enum/DevicesState.d.ts +8 -0
- package/dist/types/types/SettingsConfig.d.ts +1 -0
- package/dist/umd/index.js +3 -3
- package/package.json +1 -1
package/dist/amd/index.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* contact@stormstreaming.com
|
|
5
5
|
* https://stormstreaming.com
|
|
6
6
|
*
|
|
7
|
-
* Version: 0.9.0-beta.
|
|
8
|
-
* Version: 12/
|
|
7
|
+
* Version: 0.9.0-beta.6
|
|
8
|
+
* Version: 12/10/2024, 1:21:58 PM
|
|
9
9
|
*
|
|
10
10
|
* LEGAL NOTICE:
|
|
11
11
|
* This software is subject to the terms and conditions defined in
|
|
@@ -578,20 +578,22 @@
|
|
|
578
578
|
this.startOnDOMReady = false;
|
|
579
579
|
this.iOSOnDomReadyFix = true;
|
|
580
580
|
this._restartOnFocus = true;
|
|
581
|
+
this._forceDeviceSelection = false;
|
|
581
582
|
this.parse(config);
|
|
582
583
|
}
|
|
583
584
|
parse(config) {
|
|
584
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
585
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
585
586
|
this._settingsConfig = config;
|
|
586
587
|
this._autoConnect = (_a = this._settingsConfig.autoConnect) !== null && _a !== void 0 ? _a : this._autoConnect;
|
|
587
588
|
this._autoStart = (_b = this._settingsConfig.autoStart) !== null && _b !== void 0 ? _b : this._autoStart;
|
|
588
589
|
this._restartOnFocus = (_c = this._settingsConfig.restartOnFocus) !== null && _c !== void 0 ? _c : this._restartOnFocus;
|
|
589
590
|
this._restartOnError = (_d = this._settingsConfig.restartOnError) !== null && _d !== void 0 ? _d : this._restartOnError;
|
|
590
591
|
this._reconnectTime = (_e = this._settingsConfig.reconnectTime) !== null && _e !== void 0 ? _e : this._reconnectTime;
|
|
591
|
-
this.
|
|
592
|
-
this.
|
|
593
|
-
this.
|
|
594
|
-
this.
|
|
592
|
+
this._forceDeviceSelection = (_f = !this._settingsConfig.preselectDevices) !== null && _f !== void 0 ? _f : this._forceDeviceSelection;
|
|
593
|
+
this._videoData = new VideoData((_g = this._settingsConfig.video) !== null && _g !== void 0 ? _g : null);
|
|
594
|
+
this._audioData = new AudioData((_h = this._settingsConfig.audio) !== null && _h !== void 0 ? _h : null);
|
|
595
|
+
this._storageData = new StorageData((_j = this._settingsConfig.storage) !== null && _j !== void 0 ? _j : null);
|
|
596
|
+
this._debugData = new DebugData((_k = this._settingsConfig.debug) !== null && _k !== void 0 ? _k : null);
|
|
595
597
|
}
|
|
596
598
|
getAudioData() {
|
|
597
599
|
return this._audioData;
|
|
@@ -623,6 +625,9 @@
|
|
|
623
625
|
getDebugData() {
|
|
624
626
|
return this._debugData;
|
|
625
627
|
}
|
|
628
|
+
getIfForceSelection() {
|
|
629
|
+
return this._forceDeviceSelection;
|
|
630
|
+
}
|
|
626
631
|
getIfStartOnDOMReadyEnabled() {
|
|
627
632
|
return this.startOnDOMReady;
|
|
628
633
|
}
|
|
@@ -2467,74 +2472,103 @@
|
|
|
2467
2472
|
|
|
2468
2473
|
class SoundMeter {
|
|
2469
2474
|
constructor(main) {
|
|
2470
|
-
this._stream = null;
|
|
2471
2475
|
this._audioContext = null;
|
|
2472
2476
|
this._analyser = null;
|
|
2473
2477
|
this._microphone = null;
|
|
2474
2478
|
this._lastEventTime = 0;
|
|
2475
2479
|
this.THROTTLE_INTERVAL = 100;
|
|
2480
|
+
this._isMonitoring = false;
|
|
2476
2481
|
this._instant = 0.0;
|
|
2477
2482
|
this._slow = 0.0;
|
|
2478
|
-
this._clip = 0.0;
|
|
2479
2483
|
this._main = main;
|
|
2480
2484
|
}
|
|
2481
2485
|
attach(stream) {
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
this.
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2486
|
+
if (!stream.getAudioTracks().length) {
|
|
2487
|
+
console.warn('SoundMeter: Attempted to attach stream without audio tracks');
|
|
2488
|
+
return;
|
|
2489
|
+
}
|
|
2490
|
+
this.detach();
|
|
2491
|
+
try {
|
|
2492
|
+
this._audioContext = new AudioContext();
|
|
2493
|
+
this._microphone = this._audioContext.createMediaStreamSource(stream);
|
|
2494
|
+
this._analyser = this._audioContext.createAnalyser();
|
|
2495
|
+
this._analyser.fftSize = 2048;
|
|
2496
|
+
this._analyser.smoothingTimeConstant = 0.3;
|
|
2497
|
+
this._microphone.connect(this._analyser);
|
|
2498
|
+
this.startMonitoring();
|
|
2499
|
+
console.log('SoundMeter: Successfully attached to new audio stream');
|
|
2500
|
+
} catch (error) {
|
|
2501
|
+
console.error('SoundMeter: Error during attach:', error);
|
|
2502
|
+
this.detach();
|
|
2503
|
+
}
|
|
2490
2504
|
}
|
|
2491
2505
|
detach() {
|
|
2506
|
+
var _a, _b;
|
|
2507
|
+
this._isMonitoring = false;
|
|
2492
2508
|
if (this._microphone) {
|
|
2493
|
-
|
|
2509
|
+
try {
|
|
2510
|
+
this._microphone.disconnect();
|
|
2511
|
+
} catch (e) {
|
|
2512
|
+
console.warn('SoundMeter: Error disconnecting microphone:', e);
|
|
2513
|
+
}
|
|
2494
2514
|
this._microphone = null;
|
|
2495
2515
|
}
|
|
2496
2516
|
if (this._analyser) {
|
|
2497
|
-
|
|
2517
|
+
try {
|
|
2518
|
+
this._analyser.disconnect();
|
|
2519
|
+
} catch (e) {
|
|
2520
|
+
console.warn('SoundMeter: Error disconnecting analyser:', e);
|
|
2521
|
+
}
|
|
2498
2522
|
this._analyser = null;
|
|
2499
2523
|
}
|
|
2500
|
-
if (this._audioContext) {
|
|
2501
|
-
|
|
2502
|
-
|
|
2524
|
+
if (((_a = this._audioContext) === null || _a === void 0 ? void 0 : _a.state) !== 'closed') {
|
|
2525
|
+
try {
|
|
2526
|
+
(_b = this._audioContext) === null || _b === void 0 ? void 0 : _b.close();
|
|
2527
|
+
} catch (e) {
|
|
2528
|
+
console.warn('SoundMeter: Error closing audio context:', e);
|
|
2529
|
+
}
|
|
2503
2530
|
}
|
|
2504
|
-
this.
|
|
2531
|
+
this._audioContext = null;
|
|
2505
2532
|
this.clear();
|
|
2533
|
+
console.log('SoundMeter: Successfully detached');
|
|
2506
2534
|
}
|
|
2507
2535
|
clear() {
|
|
2508
2536
|
this._instant = 0;
|
|
2509
2537
|
this._slow = 0;
|
|
2510
|
-
this.
|
|
2538
|
+
this._lastEventTime = 0;
|
|
2511
2539
|
}
|
|
2512
2540
|
startMonitoring() {
|
|
2513
|
-
if (!this._analyser) return;
|
|
2541
|
+
if (!this._analyser || this._isMonitoring) return;
|
|
2542
|
+
this._isMonitoring = true;
|
|
2514
2543
|
const dataArray = new Float32Array(this._analyser.frequencyBinCount);
|
|
2515
2544
|
const analyze = () => {
|
|
2516
|
-
if (!this._analyser) return;
|
|
2545
|
+
if (!this._analyser || !this._isMonitoring) return;
|
|
2517
2546
|
const now = Date.now();
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2547
|
+
try {
|
|
2548
|
+
this._analyser.getFloatTimeDomainData(dataArray);
|
|
2549
|
+
let sum = 0.0;
|
|
2550
|
+
let clipcount = 0;
|
|
2551
|
+
for (let i = 0; i < dataArray.length; ++i) {
|
|
2552
|
+
const amplitude = dataArray[i];
|
|
2553
|
+
sum += amplitude * amplitude;
|
|
2554
|
+
if (Math.abs(amplitude) > 0.99) {
|
|
2555
|
+
clipcount += 1;
|
|
2556
|
+
}
|
|
2526
2557
|
}
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2558
|
+
this._instant = Math.sqrt(sum / dataArray.length);
|
|
2559
|
+
this._slow = 0.05 * this._instant + 0.95 * this._slow;
|
|
2560
|
+
if (now - this._lastEventTime >= this.THROTTLE_INTERVAL) {
|
|
2561
|
+
this._lastEventTime = now;
|
|
2562
|
+
this._main.dispatchEvent("soundMeter", {
|
|
2563
|
+
ref: this._main,
|
|
2564
|
+
high: this._instant,
|
|
2565
|
+
low: this._slow
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
} catch (error) {
|
|
2569
|
+
console.error('SoundMeter: Error during analysis:', error);
|
|
2570
|
+
this._isMonitoring = false;
|
|
2571
|
+
return;
|
|
2538
2572
|
}
|
|
2539
2573
|
requestAnimationFrame(analyze);
|
|
2540
2574
|
};
|
|
@@ -2542,6 +2576,16 @@
|
|
|
2542
2576
|
}
|
|
2543
2577
|
}
|
|
2544
2578
|
|
|
2579
|
+
exports.DevicesState = void 0;
|
|
2580
|
+
(function (DevicesState) {
|
|
2581
|
+
DevicesState["NOT_INITIALIZED"] = "NOT_INITIALIZED";
|
|
2582
|
+
DevicesState["INITIALIZED"] = "INITIALIZED";
|
|
2583
|
+
DevicesState["READY"] = "READY";
|
|
2584
|
+
DevicesState["UPDATING"] = "UPDATING";
|
|
2585
|
+
DevicesState["INVALID"] = "INVALID";
|
|
2586
|
+
DevicesState["UNKNOWN"] = "UNKNOWN";
|
|
2587
|
+
})(exports.DevicesState || (exports.DevicesState = {}));
|
|
2588
|
+
|
|
2545
2589
|
class PlaybackController {
|
|
2546
2590
|
constructor(main) {
|
|
2547
2591
|
this._isWindowActive = true;
|
|
@@ -2572,6 +2616,7 @@
|
|
|
2572
2616
|
audio: true
|
|
2573
2617
|
};
|
|
2574
2618
|
this._publishState = exports.PublishState.NOT_INITIALIZED;
|
|
2619
|
+
this._inputDeviceState = exports.DevicesState.NOT_INITIALIZED;
|
|
2575
2620
|
this.onServerDisconnect = () => {};
|
|
2576
2621
|
this.onServerConnect = () => {
|
|
2577
2622
|
if (this._peerConnection) {
|
|
@@ -2709,6 +2754,7 @@
|
|
|
2709
2754
|
handlePermissionChange(device, state) {
|
|
2710
2755
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2711
2756
|
if (state === 'denied') {
|
|
2757
|
+
this.setInputDeviceState(exports.DevicesState.INVALID);
|
|
2712
2758
|
if (this._publishState == exports.PublishState.PUBLISHED) {
|
|
2713
2759
|
this.closeStream();
|
|
2714
2760
|
}
|
|
@@ -2966,7 +3012,13 @@
|
|
|
2966
3012
|
if (deviceAccess.microphone.allowed) {
|
|
2967
3013
|
this._selectedMicrophone = this.pickMicrophone();
|
|
2968
3014
|
}
|
|
3015
|
+
if (this._selectedCamera != null && this._selectedMicrophone != null) {
|
|
3016
|
+
this.setInputDeviceState(exports.DevicesState.READY);
|
|
3017
|
+
} else {
|
|
3018
|
+
this.setInputDeviceState(exports.DevicesState.INVALID);
|
|
3019
|
+
}
|
|
2969
3020
|
} catch (error) {
|
|
3021
|
+
this.setInputDeviceState(exports.DevicesState.INVALID);
|
|
2970
3022
|
this._logger.error(this, "Errror on grab devices: " + JSON.stringify(error));
|
|
2971
3023
|
}
|
|
2972
3024
|
this._main.dispatchEvent("deviceListUpdate", {
|
|
@@ -2992,6 +3044,8 @@
|
|
|
2992
3044
|
}
|
|
2993
3045
|
selectCamera(cameraID) {
|
|
2994
3046
|
var _a, _b;
|
|
3047
|
+
this._selectedCamera = null;
|
|
3048
|
+
this.setInputDeviceState(exports.DevicesState.UPDATING);
|
|
2995
3049
|
const streamKey = (_a = this._main.getConfigManager()) === null || _a === void 0 ? void 0 : _a.getStreamData().streamKey;
|
|
2996
3050
|
const wasPublished = this._publishState === exports.PublishState.PUBLISHED;
|
|
2997
3051
|
for (let i = 0; i < this._cameraList.getSize(); i++) {
|
|
@@ -3003,16 +3057,27 @@
|
|
|
3003
3057
|
}
|
|
3004
3058
|
}
|
|
3005
3059
|
this.stopCameraStream();
|
|
3006
|
-
this.
|
|
3007
|
-
|
|
3008
|
-
if (
|
|
3009
|
-
this.
|
|
3060
|
+
if (this._selectedCamera != null) {
|
|
3061
|
+
this._constraints.video.deviceId = this._selectedCamera.getID();
|
|
3062
|
+
if (this._selectedCamera != null && this._selectedMicrophone != null) {
|
|
3063
|
+
this.setInputDeviceState(exports.DevicesState.READY);
|
|
3064
|
+
} else {
|
|
3065
|
+
this.setInputDeviceState(exports.DevicesState.INVALID);
|
|
3010
3066
|
}
|
|
3011
|
-
|
|
3067
|
+
this.startCamera().then(() => {
|
|
3068
|
+
if (wasPublished && streamKey) {
|
|
3069
|
+
this.publish(streamKey);
|
|
3070
|
+
}
|
|
3071
|
+
});
|
|
3072
|
+
} else {
|
|
3073
|
+
this.setInputDeviceState(exports.DevicesState.INVALID);
|
|
3074
|
+
}
|
|
3012
3075
|
}
|
|
3013
3076
|
selectMicrophone(micID) {
|
|
3014
|
-
var _a, _b, _c, _d
|
|
3077
|
+
var _a, _b, _c, _d;
|
|
3015
3078
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3079
|
+
this._selectedMicrophone = null;
|
|
3080
|
+
this.setInputDeviceState(exports.DevicesState.UPDATING);
|
|
3016
3081
|
console.log("š¤ Selecting microphone:", micID);
|
|
3017
3082
|
const streamKey = (_a = this._main.getConfigManager()) === null || _a === void 0 ? void 0 : _a.getStreamData().streamKey;
|
|
3018
3083
|
const wasPublished = this._publishState === exports.PublishState.PUBLISHED;
|
|
@@ -3024,33 +3089,41 @@
|
|
|
3024
3089
|
}
|
|
3025
3090
|
}
|
|
3026
3091
|
this._soundMeter.detach();
|
|
3027
|
-
(_c = this._stream) === null || _c === void 0 ? void 0 : _c.getAudioTracks().forEach(track => track.stop());
|
|
3028
3092
|
try {
|
|
3029
3093
|
const audioStream = yield navigator.mediaDevices.getUserMedia({
|
|
3030
3094
|
audio: {
|
|
3031
3095
|
deviceId: {
|
|
3032
|
-
exact: (
|
|
3096
|
+
exact: (_c = this._selectedMicrophone) === null || _c === void 0 ? void 0 : _c.getID()
|
|
3033
3097
|
}
|
|
3034
3098
|
}
|
|
3035
3099
|
});
|
|
3036
|
-
const oldAudioTracks = ((
|
|
3100
|
+
const oldAudioTracks = ((_d = this._stream) === null || _d === void 0 ? void 0 : _d.getAudioTracks()) || [];
|
|
3037
3101
|
oldAudioTracks.forEach(track => {
|
|
3038
3102
|
var _a;
|
|
3039
3103
|
(_a = this._stream) === null || _a === void 0 ? void 0 : _a.removeTrack(track);
|
|
3040
3104
|
track.stop();
|
|
3041
3105
|
});
|
|
3042
3106
|
const newAudioTrack = audioStream.getAudioTracks()[0];
|
|
3043
|
-
(_f = this._stream) === null || _f === void 0 ? void 0 : _f.addTrack(newAudioTrack);
|
|
3044
|
-
this._soundMeter.detach();
|
|
3045
|
-
yield new Promise(resolve => setTimeout(resolve, 100));
|
|
3046
3107
|
if (this._stream) {
|
|
3047
|
-
this.
|
|
3108
|
+
this._stream.addTrack(newAudioTrack);
|
|
3109
|
+
if (newAudioTrack.readyState === 'live') {
|
|
3110
|
+
this._soundMeter.attach(this._stream);
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
if (this._selectedCamera != null && this._selectedMicrophone != null) {
|
|
3114
|
+
this.setInputDeviceState(exports.DevicesState.READY);
|
|
3115
|
+
} else {
|
|
3116
|
+
this.setInputDeviceState(exports.DevicesState.INVALID);
|
|
3048
3117
|
}
|
|
3049
3118
|
if (wasPublished && streamKey) {
|
|
3050
3119
|
this.publish(streamKey);
|
|
3051
3120
|
}
|
|
3052
3121
|
} catch (error) {
|
|
3053
3122
|
console.error("Error changing microphone:", error);
|
|
3123
|
+
this.setInputDeviceState(exports.DevicesState.INVALID);
|
|
3124
|
+
this._main.dispatchEvent("inputDeviceError", {
|
|
3125
|
+
ref: this._main
|
|
3126
|
+
});
|
|
3054
3127
|
}
|
|
3055
3128
|
});
|
|
3056
3129
|
}
|
|
@@ -3123,7 +3196,7 @@
|
|
|
3123
3196
|
this.setPublishState(exports.PublishState.UNPUBLISHED);
|
|
3124
3197
|
}
|
|
3125
3198
|
pickCamera() {
|
|
3126
|
-
var _a, _b;
|
|
3199
|
+
var _a, _b, _c, _d;
|
|
3127
3200
|
for (let i = 0; i < this._cameraList.getSize(); i++) {
|
|
3128
3201
|
this._cameraList.get(i).setSelected(false);
|
|
3129
3202
|
}
|
|
@@ -3142,18 +3215,25 @@
|
|
|
3142
3215
|
}
|
|
3143
3216
|
if (!found) {
|
|
3144
3217
|
this._main.dispatchEvent("savedCameraNotFound", {
|
|
3145
|
-
ref: this._main
|
|
3218
|
+
ref: this._main,
|
|
3219
|
+
savedDeviceID: savedCameraID
|
|
3146
3220
|
});
|
|
3147
|
-
|
|
3221
|
+
return null;
|
|
3148
3222
|
}
|
|
3149
3223
|
}
|
|
3150
3224
|
if (!this._selectedCamera) {
|
|
3151
3225
|
this._main.dispatchEvent("savedCameraNotFound", {
|
|
3152
|
-
ref: this._main
|
|
3226
|
+
ref: this._main,
|
|
3227
|
+
savedDeviceID: null
|
|
3153
3228
|
});
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3229
|
+
if (!((_c = this._main.getConfigManager()) === null || _c === void 0 ? void 0 : _c.getSettingsData().getIfForceSelection())) {
|
|
3230
|
+
this._selectedCamera = this._cameraList.get(0);
|
|
3231
|
+
this._selectedCamera.setSelected(true);
|
|
3232
|
+
(_d = this._main.getStorageManager()) === null || _d === void 0 ? void 0 : _d.saveField("cameraID", this._selectedCamera.getID());
|
|
3233
|
+
this._constraints.video.deviceId = this._selectedCamera.getID();
|
|
3234
|
+
} else {
|
|
3235
|
+
return null;
|
|
3236
|
+
}
|
|
3157
3237
|
}
|
|
3158
3238
|
}
|
|
3159
3239
|
this._main.dispatchEvent("deviceListUpdate", {
|
|
@@ -3164,7 +3244,7 @@
|
|
|
3164
3244
|
return this._selectedCamera;
|
|
3165
3245
|
}
|
|
3166
3246
|
pickMicrophone() {
|
|
3167
|
-
var _a, _b;
|
|
3247
|
+
var _a, _b, _c, _d;
|
|
3168
3248
|
for (let i = 0; i < this._microphoneList.getSize(); i++) {
|
|
3169
3249
|
this._microphoneList.get(i).setSelected(false);
|
|
3170
3250
|
}
|
|
@@ -3181,13 +3261,23 @@
|
|
|
3181
3261
|
}
|
|
3182
3262
|
if (!found) {
|
|
3183
3263
|
this._main.dispatchEvent("savedMicrophoneNotFound", {
|
|
3184
|
-
ref: this._main
|
|
3264
|
+
ref: this._main,
|
|
3265
|
+
savedDeviceID: savedMicID
|
|
3185
3266
|
});
|
|
3186
|
-
|
|
3267
|
+
return null;
|
|
3187
3268
|
}
|
|
3188
3269
|
}
|
|
3189
3270
|
if (!this._selectedMicrophone) {
|
|
3190
|
-
this.
|
|
3271
|
+
this._main.dispatchEvent("savedMicrophoneNotFound", {
|
|
3272
|
+
ref: this._main,
|
|
3273
|
+
savedDeviceID: null
|
|
3274
|
+
});
|
|
3275
|
+
if (!((_c = this._main.getConfigManager()) === null || _c === void 0 ? void 0 : _c.getSettingsData().getIfForceSelection())) {
|
|
3276
|
+
this._selectedMicrophone = this._microphoneList.get(0);
|
|
3277
|
+
(_d = this._main.getStorageManager()) === null || _d === void 0 ? void 0 : _d.saveField("microphoneID", this._selectedMicrophone.getID());
|
|
3278
|
+
} else {
|
|
3279
|
+
return null;
|
|
3280
|
+
}
|
|
3191
3281
|
}
|
|
3192
3282
|
this._selectedMicrophone.setSelected(true);
|
|
3193
3283
|
this._constraints.audio = {
|
|
@@ -3267,12 +3357,23 @@
|
|
|
3267
3357
|
return this._selectedMicrophone;
|
|
3268
3358
|
}
|
|
3269
3359
|
setPublishState(newState) {
|
|
3360
|
+
console.log('%cāµ š„ setPublishState: ' + newState, 'background: green; color: white;');
|
|
3270
3361
|
this._publishState = newState;
|
|
3271
3362
|
this._main.dispatchEvent("publishStateChange", {
|
|
3272
3363
|
ref: this._main,
|
|
3273
3364
|
state: this._publishState
|
|
3274
3365
|
});
|
|
3275
3366
|
}
|
|
3367
|
+
setInputDeviceState(newState) {
|
|
3368
|
+
console.log('%cāµ š„ setInputDeviceState: ' + newState, 'background: green; color: white;');
|
|
3369
|
+
this._inputDeviceState = newState;
|
|
3370
|
+
this._main.dispatchEvent("deviceStateChange", {
|
|
3371
|
+
ref: this._main,
|
|
3372
|
+
state: this._inputDeviceState,
|
|
3373
|
+
selectedCamera: this._selectedCamera,
|
|
3374
|
+
selectedMicrophone: this._selectedMicrophone
|
|
3375
|
+
});
|
|
3376
|
+
}
|
|
3276
3377
|
getCameraList() {
|
|
3277
3378
|
return this._cameraList != null ? this._cameraList.getArray() : [];
|
|
3278
3379
|
}
|
|
@@ -3282,6 +3383,9 @@
|
|
|
3282
3383
|
getPublishState() {
|
|
3283
3384
|
return this._publishState;
|
|
3284
3385
|
}
|
|
3386
|
+
getInputDeviceState() {
|
|
3387
|
+
return this._inputDeviceState;
|
|
3388
|
+
}
|
|
3285
3389
|
getPlayer() {
|
|
3286
3390
|
return this._selectedPlayer;
|
|
3287
3391
|
}
|
|
@@ -3685,8 +3789,8 @@
|
|
|
3685
3789
|
constructor(streamConfig, autoInitialize = false) {
|
|
3686
3790
|
super();
|
|
3687
3791
|
this.DEV_MODE = true;
|
|
3688
|
-
this.STREAMER_VERSION = "0.9.0-beta.
|
|
3689
|
-
this.COMPILE_DATE = "12/
|
|
3792
|
+
this.STREAMER_VERSION = "0.9.0-beta.6";
|
|
3793
|
+
this.COMPILE_DATE = "12/10/2024, 1:21:57 PM";
|
|
3690
3794
|
this.STREAMER_BRANCH = "Experimental";
|
|
3691
3795
|
this.STREAMER_PROTOCOL_VERSION = 1;
|
|
3692
3796
|
this._initialized = false;
|
|
@@ -3842,6 +3946,10 @@
|
|
|
3842
3946
|
var _a, _b;
|
|
3843
3947
|
return (_b = (_a = this._playbackController) === null || _a === void 0 ? void 0 : _a.publish(streamKey)) !== null && _b !== void 0 ? _b : false;
|
|
3844
3948
|
}
|
|
3949
|
+
getDeviceState() {
|
|
3950
|
+
var _a, _b;
|
|
3951
|
+
return (_b = (_a = this._playbackController) === null || _a === void 0 ? void 0 : _a.getInputDeviceState()) !== null && _b !== void 0 ? _b : exports.DevicesState.NOT_INITIALIZED;
|
|
3952
|
+
}
|
|
3845
3953
|
clearSavedDevices() {
|
|
3846
3954
|
var _a;
|
|
3847
3955
|
return (_a = this._playbackController) === null || _a === void 0 ? void 0 : _a.clearSavedDevices();
|