@stormstreaming/stormstreamer 0.9.0-beta.5 → 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 CHANGED
@@ -4,8 +4,8 @@
4
4
  * contact@stormstreaming.com
5
5
  * https://stormstreaming.com
6
6
  *
7
- * Version: 0.9.0-beta.5
8
- * Version: 12/10/2024, 10:26:03 AM
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
@@ -589,7 +589,7 @@
589
589
  this._restartOnFocus = (_c = this._settingsConfig.restartOnFocus) !== null && _c !== void 0 ? _c : this._restartOnFocus;
590
590
  this._restartOnError = (_d = this._settingsConfig.restartOnError) !== null && _d !== void 0 ? _d : this._restartOnError;
591
591
  this._reconnectTime = (_e = this._settingsConfig.reconnectTime) !== null && _e !== void 0 ? _e : this._reconnectTime;
592
- this._forceDeviceSelection = (_f = this._settingsConfig.forceDeviceSelection) !== null && _f !== void 0 ? _f : this._forceDeviceSelection;
592
+ this._forceDeviceSelection = (_f = !this._settingsConfig.preselectDevices) !== null && _f !== void 0 ? _f : this._forceDeviceSelection;
593
593
  this._videoData = new VideoData((_g = this._settingsConfig.video) !== null && _g !== void 0 ? _g : null);
594
594
  this._audioData = new AudioData((_h = this._settingsConfig.audio) !== null && _h !== void 0 ? _h : null);
595
595
  this._storageData = new StorageData((_j = this._settingsConfig.storage) !== null && _j !== void 0 ? _j : null);
@@ -2576,15 +2576,15 @@
2576
2576
  }
2577
2577
  }
2578
2578
 
2579
- var InputDeviceState;
2580
- (function (InputDeviceState) {
2581
- InputDeviceState["NOT_INITIALIZED"] = "NOT_INITIALIZED";
2582
- InputDeviceState["INITIALIZED"] = "INITIALIZED";
2583
- InputDeviceState["READY"] = "READY";
2584
- InputDeviceState["UPDATING"] = "UPDATING";
2585
- InputDeviceState["INVALID"] = "INVALID";
2586
- InputDeviceState["UNKNOWN"] = "UNKNOWN";
2587
- })(InputDeviceState || (InputDeviceState = {}));
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
2588
 
2589
2589
  class PlaybackController {
2590
2590
  constructor(main) {
@@ -2616,7 +2616,7 @@
2616
2616
  audio: true
2617
2617
  };
2618
2618
  this._publishState = exports.PublishState.NOT_INITIALIZED;
2619
- this._inputDeviceState = InputDeviceState.NOT_INITIALIZED;
2619
+ this._inputDeviceState = exports.DevicesState.NOT_INITIALIZED;
2620
2620
  this.onServerDisconnect = () => {};
2621
2621
  this.onServerConnect = () => {
2622
2622
  if (this._peerConnection) {
@@ -2754,7 +2754,7 @@
2754
2754
  handlePermissionChange(device, state) {
2755
2755
  return __awaiter(this, void 0, void 0, function* () {
2756
2756
  if (state === 'denied') {
2757
- this.setInputDeviceState(InputDeviceState.INVALID);
2757
+ this.setInputDeviceState(exports.DevicesState.INVALID);
2758
2758
  if (this._publishState == exports.PublishState.PUBLISHED) {
2759
2759
  this.closeStream();
2760
2760
  }
@@ -3013,12 +3013,12 @@
3013
3013
  this._selectedMicrophone = this.pickMicrophone();
3014
3014
  }
3015
3015
  if (this._selectedCamera != null && this._selectedMicrophone != null) {
3016
- this.setInputDeviceState(InputDeviceState.READY);
3016
+ this.setInputDeviceState(exports.DevicesState.READY);
3017
3017
  } else {
3018
- this.setInputDeviceState(InputDeviceState.INVALID);
3018
+ this.setInputDeviceState(exports.DevicesState.INVALID);
3019
3019
  }
3020
3020
  } catch (error) {
3021
- this.setInputDeviceState(InputDeviceState.INVALID);
3021
+ this.setInputDeviceState(exports.DevicesState.INVALID);
3022
3022
  this._logger.error(this, "Errror on grab devices: " + JSON.stringify(error));
3023
3023
  }
3024
3024
  this._main.dispatchEvent("deviceListUpdate", {
@@ -3045,7 +3045,7 @@
3045
3045
  selectCamera(cameraID) {
3046
3046
  var _a, _b;
3047
3047
  this._selectedCamera = null;
3048
- this.setInputDeviceState(InputDeviceState.UPDATING);
3048
+ this.setInputDeviceState(exports.DevicesState.UPDATING);
3049
3049
  const streamKey = (_a = this._main.getConfigManager()) === null || _a === void 0 ? void 0 : _a.getStreamData().streamKey;
3050
3050
  const wasPublished = this._publishState === exports.PublishState.PUBLISHED;
3051
3051
  for (let i = 0; i < this._cameraList.getSize(); i++) {
@@ -3060,9 +3060,9 @@
3060
3060
  if (this._selectedCamera != null) {
3061
3061
  this._constraints.video.deviceId = this._selectedCamera.getID();
3062
3062
  if (this._selectedCamera != null && this._selectedMicrophone != null) {
3063
- this.setInputDeviceState(InputDeviceState.READY);
3063
+ this.setInputDeviceState(exports.DevicesState.READY);
3064
3064
  } else {
3065
- this.setInputDeviceState(InputDeviceState.INVALID);
3065
+ this.setInputDeviceState(exports.DevicesState.INVALID);
3066
3066
  }
3067
3067
  this.startCamera().then(() => {
3068
3068
  if (wasPublished && streamKey) {
@@ -3070,14 +3070,14 @@
3070
3070
  }
3071
3071
  });
3072
3072
  } else {
3073
- this.setInputDeviceState(InputDeviceState.INVALID);
3073
+ this.setInputDeviceState(exports.DevicesState.INVALID);
3074
3074
  }
3075
3075
  }
3076
3076
  selectMicrophone(micID) {
3077
3077
  var _a, _b, _c, _d;
3078
3078
  return __awaiter(this, void 0, void 0, function* () {
3079
3079
  this._selectedMicrophone = null;
3080
- this.setInputDeviceState(InputDeviceState.UPDATING);
3080
+ this.setInputDeviceState(exports.DevicesState.UPDATING);
3081
3081
  console.log("šŸŽ¤ Selecting microphone:", micID);
3082
3082
  const streamKey = (_a = this._main.getConfigManager()) === null || _a === void 0 ? void 0 : _a.getStreamData().streamKey;
3083
3083
  const wasPublished = this._publishState === exports.PublishState.PUBLISHED;
@@ -3111,16 +3111,16 @@
3111
3111
  }
3112
3112
  }
3113
3113
  if (this._selectedCamera != null && this._selectedMicrophone != null) {
3114
- this.setInputDeviceState(InputDeviceState.READY);
3114
+ this.setInputDeviceState(exports.DevicesState.READY);
3115
3115
  } else {
3116
- this.setInputDeviceState(InputDeviceState.INVALID);
3116
+ this.setInputDeviceState(exports.DevicesState.INVALID);
3117
3117
  }
3118
3118
  if (wasPublished && streamKey) {
3119
3119
  this.publish(streamKey);
3120
3120
  }
3121
3121
  } catch (error) {
3122
3122
  console.error("Error changing microphone:", error);
3123
- this.setInputDeviceState(InputDeviceState.INVALID);
3123
+ this.setInputDeviceState(exports.DevicesState.INVALID);
3124
3124
  this._main.dispatchEvent("inputDeviceError", {
3125
3125
  ref: this._main
3126
3126
  });
@@ -3196,7 +3196,7 @@
3196
3196
  this.setPublishState(exports.PublishState.UNPUBLISHED);
3197
3197
  }
3198
3198
  pickCamera() {
3199
- var _a, _b, _c;
3199
+ var _a, _b, _c, _d;
3200
3200
  for (let i = 0; i < this._cameraList.getSize(); i++) {
3201
3201
  this._cameraList.get(i).setSelected(false);
3202
3202
  }
@@ -3229,6 +3229,7 @@
3229
3229
  if (!((_c = this._main.getConfigManager()) === null || _c === void 0 ? void 0 : _c.getSettingsData().getIfForceSelection())) {
3230
3230
  this._selectedCamera = this._cameraList.get(0);
3231
3231
  this._selectedCamera.setSelected(true);
3232
+ (_d = this._main.getStorageManager()) === null || _d === void 0 ? void 0 : _d.saveField("cameraID", this._selectedCamera.getID());
3232
3233
  this._constraints.video.deviceId = this._selectedCamera.getID();
3233
3234
  } else {
3234
3235
  return null;
@@ -3243,7 +3244,7 @@
3243
3244
  return this._selectedCamera;
3244
3245
  }
3245
3246
  pickMicrophone() {
3246
- var _a, _b, _c;
3247
+ var _a, _b, _c, _d;
3247
3248
  for (let i = 0; i < this._microphoneList.getSize(); i++) {
3248
3249
  this._microphoneList.get(i).setSelected(false);
3249
3250
  }
@@ -3273,6 +3274,7 @@
3273
3274
  });
3274
3275
  if (!((_c = this._main.getConfigManager()) === null || _c === void 0 ? void 0 : _c.getSettingsData().getIfForceSelection())) {
3275
3276
  this._selectedMicrophone = this._microphoneList.get(0);
3277
+ (_d = this._main.getStorageManager()) === null || _d === void 0 ? void 0 : _d.saveField("microphoneID", this._selectedMicrophone.getID());
3276
3278
  } else {
3277
3279
  return null;
3278
3280
  }
@@ -3355,6 +3357,7 @@
3355
3357
  return this._selectedMicrophone;
3356
3358
  }
3357
3359
  setPublishState(newState) {
3360
+ console.log('%cāµ šŸŽ„ setPublishState: ' + newState, 'background: green; color: white;');
3358
3361
  this._publishState = newState;
3359
3362
  this._main.dispatchEvent("publishStateChange", {
3360
3363
  ref: this._main,
@@ -3362,6 +3365,7 @@
3362
3365
  });
3363
3366
  }
3364
3367
  setInputDeviceState(newState) {
3368
+ console.log('%cāµ šŸŽ„ setInputDeviceState: ' + newState, 'background: green; color: white;');
3365
3369
  this._inputDeviceState = newState;
3366
3370
  this._main.dispatchEvent("deviceStateChange", {
3367
3371
  ref: this._main,
@@ -3785,8 +3789,8 @@
3785
3789
  constructor(streamConfig, autoInitialize = false) {
3786
3790
  super();
3787
3791
  this.DEV_MODE = true;
3788
- this.STREAMER_VERSION = "0.9.0-beta.5";
3789
- this.COMPILE_DATE = "12/10/2024, 10:26:02 AM";
3792
+ this.STREAMER_VERSION = "0.9.0-beta.6";
3793
+ this.COMPILE_DATE = "12/10/2024, 1:21:57 PM";
3790
3794
  this.STREAMER_BRANCH = "Experimental";
3791
3795
  this.STREAMER_PROTOCOL_VERSION = 1;
3792
3796
  this._initialized = false;
@@ -3944,7 +3948,7 @@
3944
3948
  }
3945
3949
  getDeviceState() {
3946
3950
  var _a, _b;
3947
- return (_b = (_a = this._playbackController) === null || _a === void 0 ? void 0 : _a.getInputDeviceState()) !== null && _b !== void 0 ? _b : InputDeviceState.NOT_INITIALIZED;
3951
+ return (_b = (_a = this._playbackController) === null || _a === void 0 ? void 0 : _a.getInputDeviceState()) !== null && _b !== void 0 ? _b : exports.DevicesState.NOT_INITIALIZED;
3948
3952
  }
3949
3953
  clearSavedDevices() {
3950
3954
  var _a;