@stormstreaming/stormstreamer 0.9.2-beta.0 → 0.9.2-beta.1

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.2-beta.0
8
- * Version: 3/6/2025, 12:46:46 PM
7
+ * Version: 0.9.2-beta.1
8
+ * Version: 3/6/2025, 1:40:53 PM
9
9
  *
10
10
  * LEGAL NOTICE:
11
11
  * This software is subject to the terms and conditions defined in
@@ -2587,16 +2587,16 @@
2587
2587
  }
2588
2588
  }
2589
2589
 
2590
- exports.StreamerState = void 0;
2591
- (function (StreamerState) {
2592
- StreamerState["NOT_INITIALIZED"] = "NOT_INITIALIZED";
2593
- StreamerState["INITIALIZED"] = "INITIALIZED";
2594
- StreamerState["READY"] = "READY";
2595
- StreamerState["UPDATING"] = "UPDATING";
2596
- StreamerState["INVALID"] = "INVALID";
2597
- StreamerState["UNKNOWN"] = "UNKNOWN";
2598
- StreamerState["STOPPED"] = "STOPPED";
2599
- })(exports.StreamerState || (exports.StreamerState = {}));
2590
+ exports.InputDevicesState = void 0;
2591
+ (function (InputDevicesState) {
2592
+ InputDevicesState["NOT_INITIALIZED"] = "NOT_INITIALIZED";
2593
+ InputDevicesState["INITIALIZED"] = "INITIALIZED";
2594
+ InputDevicesState["READY"] = "READY";
2595
+ InputDevicesState["UPDATING"] = "UPDATING";
2596
+ InputDevicesState["INVALID"] = "INVALID";
2597
+ InputDevicesState["UNKNOWN"] = "UNKNOWN";
2598
+ InputDevicesState["STOPPED"] = "STOPPED";
2599
+ })(exports.InputDevicesState || (exports.InputDevicesState = {}));
2600
2600
 
2601
2601
  exports.DeviceState = void 0;
2602
2602
  (function (DeviceState) {
@@ -2977,7 +2977,7 @@
2977
2977
  this._restartTimerMaxCount = 5;
2978
2978
  this._publishState = exports.PublishState.NOT_INITIALIZED;
2979
2979
  this._publishTime = 0;
2980
- this._inputDeviceState = exports.StreamerState.NOT_INITIALIZED;
2980
+ this._inputDeviceState = exports.InputDevicesState.NOT_INITIALIZED;
2981
2981
  this._cameraState = exports.DeviceState.NOT_INITIALIZED;
2982
2982
  this._microphoneState = exports.DeviceState.NOT_INITIALIZED;
2983
2983
  this._publishTimer = 0;
@@ -2987,7 +2987,7 @@
2987
2987
  this.onDeviceStateChange = event => {
2988
2988
  var _a;
2989
2989
  const usedStreamKey = (_a = this._main.getConfigManager()) === null || _a === void 0 ? void 0 : _a.getStreamData().streamKey;
2990
- if (event.state == exports.StreamerState.READY && usedStreamKey != null) {
2990
+ if (event.state == exports.InputDevicesState.READY && usedStreamKey != null) {
2991
2991
  this.publish(usedStreamKey);
2992
2992
  }
2993
2993
  };
@@ -3014,7 +3014,7 @@
3014
3014
  }
3015
3015
  } catch (error) {
3016
3016
  this._logger.error(this, "Error restarting stream after orientation change: " + JSON.stringify(error));
3017
- this.setInputDeviceState(exports.StreamerState.INVALID);
3017
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3018
3018
  }
3019
3019
  }
3020
3020
  });
@@ -3173,7 +3173,7 @@
3173
3173
  }
3174
3174
  } catch (error) {
3175
3175
  this._logger.error(this, "Initialization failed: " + JSON.stringify(error));
3176
- this.setInputDeviceState(exports.StreamerState.INVALID);
3176
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3177
3177
  }
3178
3178
  });
3179
3179
  }
@@ -3232,7 +3232,7 @@
3232
3232
  handlePermissionChange(device, state) {
3233
3233
  return __awaiter(this, void 0, void 0, function* () {
3234
3234
  if (state === 'denied') {
3235
- this.setInputDeviceState(exports.StreamerState.INVALID);
3235
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3236
3236
  if (this._publishState == exports.PublishState.CONNECTED) {
3237
3237
  this.closeStream();
3238
3238
  }
@@ -3486,26 +3486,26 @@
3486
3486
  ref: this._main
3487
3487
  });
3488
3488
  this.setCameraState(exports.DeviceState.ACCESS_DENIED);
3489
- this.setInputDeviceState(exports.StreamerState.INVALID);
3489
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3490
3490
  } else if (!deviceAccess.camera.available) {
3491
3491
  this._main.dispatchEvent("noCameraFound", {
3492
3492
  ref: this._main
3493
3493
  });
3494
3494
  this.setCameraState(exports.DeviceState.NOT_FOUND);
3495
- this.setInputDeviceState(exports.StreamerState.INVALID);
3495
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3496
3496
  }
3497
3497
  if (!deviceAccess.microphone.allowed) {
3498
3498
  this._main.dispatchEvent("microphoneAccessDenied", {
3499
3499
  ref: this._main
3500
3500
  });
3501
3501
  this.setMicrophoneState(exports.DeviceState.ACCESS_DENIED);
3502
- this.setInputDeviceState(exports.StreamerState.INVALID);
3502
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3503
3503
  } else if (!deviceAccess.microphone.available) {
3504
3504
  this._main.dispatchEvent("noMicrophoneFound", {
3505
3505
  ref: this._main
3506
3506
  });
3507
3507
  this.setMicrophoneState(exports.DeviceState.NOT_FOUND);
3508
- this.setInputDeviceState(exports.StreamerState.INVALID);
3508
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3509
3509
  }
3510
3510
  }
3511
3511
  const devices = yield navigator.mediaDevices.enumerateDevices();
@@ -3528,7 +3528,7 @@
3528
3528
  this._selectedMicrophone = this.pickMicrophone();
3529
3529
  }
3530
3530
  } catch (error) {
3531
- this.setInputDeviceState(exports.StreamerState.INVALID);
3531
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3532
3532
  this._logger.error(this, "Errror on grab devices: " + JSON.stringify(error));
3533
3533
  }
3534
3534
  this._main.dispatchEvent("deviceListUpdate", {
@@ -3558,7 +3558,7 @@
3558
3558
  this._cameraList.get(i).setSelected(false);
3559
3559
  }
3560
3560
  this._selectedCamera = null;
3561
- this.setInputDeviceState(exports.StreamerState.UPDATING);
3561
+ this.setInputDeviceState(exports.InputDevicesState.UPDATING);
3562
3562
  this.setCameraState(exports.DeviceState.NOT_INITIALIZED);
3563
3563
  const streamKey = (_a = this._main.getConfigManager()) === null || _a === void 0 ? void 0 : _a.getStreamData().streamKey;
3564
3564
  const wasPublished = this._publishState === exports.PublishState.CONNECTED;
@@ -3580,13 +3580,13 @@
3580
3580
  this._constraints.video.deviceId = this._selectedCamera.getID();
3581
3581
  this.startCamera().then(() => {
3582
3582
  this.setCameraState(exports.DeviceState.ENABLED);
3583
- if (this._cameraState == exports.DeviceState.ENABLED && this._microphoneState == exports.DeviceState.ENABLED) this.setInputDeviceState(exports.StreamerState.READY);else this.setInputDeviceState(exports.StreamerState.INVALID);
3583
+ if (this._cameraState == exports.DeviceState.ENABLED && this._microphoneState == exports.DeviceState.ENABLED) this.setInputDeviceState(exports.InputDevicesState.READY);else this.setInputDeviceState(exports.InputDevicesState.INVALID);
3584
3584
  if (wasPublished && streamKey) {
3585
3585
  this.publish(streamKey);
3586
3586
  }
3587
3587
  });
3588
3588
  } else {
3589
- this.setInputDeviceState(exports.StreamerState.INVALID);
3589
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3590
3590
  }
3591
3591
  }
3592
3592
  selectMicrophone(micID) {
@@ -3596,7 +3596,7 @@
3596
3596
  this._microphoneList.get(i).setSelected(false);
3597
3597
  }
3598
3598
  this._selectedMicrophone = null;
3599
- this.setInputDeviceState(exports.StreamerState.UPDATING);
3599
+ this.setInputDeviceState(exports.InputDevicesState.UPDATING);
3600
3600
  this.setMicrophoneState(exports.DeviceState.NOT_INITIALIZED);
3601
3601
  this._logger.info(this, "Selecting microphone: " + micID);
3602
3602
  const streamKey = (_a = this._main.getConfigManager()) === null || _a === void 0 ? void 0 : _a.getStreamData().streamKey;
@@ -3626,9 +3626,9 @@
3626
3626
  yield this.startCamera();
3627
3627
  this.setMicrophoneState(exports.DeviceState.ENABLED);
3628
3628
  if (this._cameraState == exports.DeviceState.ENABLED && this._microphoneState == exports.DeviceState.ENABLED) {
3629
- this.setInputDeviceState(exports.StreamerState.READY);
3629
+ this.setInputDeviceState(exports.InputDevicesState.READY);
3630
3630
  } else {
3631
- this.setInputDeviceState(exports.StreamerState.INVALID);
3631
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3632
3632
  }
3633
3633
  if (wasPublished && streamKey) {
3634
3634
  this.publish(streamKey);
@@ -3638,7 +3638,7 @@
3638
3638
  this._main.dispatchEvent("inputDeviceError", {
3639
3639
  ref: this._main
3640
3640
  });
3641
- this.setInputDeviceState(exports.StreamerState.INVALID);
3641
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3642
3642
  }
3643
3643
  });
3644
3644
  }
@@ -3683,7 +3683,7 @@
3683
3683
  });
3684
3684
  }
3685
3685
  }
3686
- if (this._cameraState == exports.DeviceState.ENABLED && this._microphoneState == exports.DeviceState.ENABLED) this.setInputDeviceState(exports.StreamerState.READY);
3686
+ if (this._cameraState == exports.DeviceState.ENABLED && this._microphoneState == exports.DeviceState.ENABLED) this.setInputDeviceState(exports.InputDevicesState.READY);
3687
3687
  } catch (error) {
3688
3688
  console.error("Error in startCamera:", error);
3689
3689
  yield this.grabDevices();
@@ -3729,7 +3729,7 @@
3729
3729
  }
3730
3730
  if (!found) {
3731
3731
  this.setCameraState(exports.DeviceState.NOT_FOUND);
3732
- this.setInputDeviceState(exports.StreamerState.INVALID);
3732
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3733
3733
  this._main.dispatchEvent("savedCameraNotFound", {
3734
3734
  ref: this._main,
3735
3735
  savedDeviceID: savedCameraID
@@ -3758,7 +3758,7 @@
3758
3758
  this.setCameraState(exports.DeviceState.ENABLED);
3759
3759
  } else {
3760
3760
  this.setCameraState(exports.DeviceState.NOT_FOUND);
3761
- this.setInputDeviceState(exports.StreamerState.INVALID);
3761
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3762
3762
  return null;
3763
3763
  }
3764
3764
  }
@@ -3793,7 +3793,7 @@
3793
3793
  savedDeviceID: savedMicID
3794
3794
  });
3795
3795
  this.setMicrophoneState(exports.DeviceState.NOT_FOUND);
3796
- this.setInputDeviceState(exports.StreamerState.INVALID);
3796
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3797
3797
  if ((_c = this._main.getConfigManager()) === null || _c === void 0 ? void 0 : _c.getSettingsData().getIfCancelPublishOnError()) {
3798
3798
  this._logger.info(this, "Canceling Publish!");
3799
3799
  this._main.getConfigManager().getStreamData().streamKey = null;
@@ -3816,7 +3816,7 @@
3816
3816
  (_f = this._main.getStorageManager()) === null || _f === void 0 ? void 0 : _f.saveField("microphoneID", this._selectedMicrophone.getID());
3817
3817
  } else {
3818
3818
  this.setMicrophoneState(exports.DeviceState.NOT_FOUND);
3819
- this.setInputDeviceState(exports.StreamerState.INVALID);
3819
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
3820
3820
  return null;
3821
3821
  }
3822
3822
  }
@@ -4052,7 +4052,7 @@
4052
4052
  this.closeWebRTCConnection();
4053
4053
  this.stopCameraStream();
4054
4054
  this.setPublishState(exports.PublishState.STOPPED);
4055
- this.setInputDeviceState(exports.StreamerState.STOPPED);
4055
+ this.setInputDeviceState(exports.InputDevicesState.STOPPED);
4056
4056
  this.setCameraState(exports.DeviceState.STOPPED);
4057
4057
  this.setMicrophoneState(exports.DeviceState.STOPPED);
4058
4058
  if (this._restartTimer) {
@@ -4067,7 +4067,7 @@
4067
4067
  return __awaiter(this, void 0, void 0, function* () {
4068
4068
  try {
4069
4069
  this._publishState = exports.PublishState.NOT_INITIALIZED;
4070
- this._inputDeviceState = exports.StreamerState.NOT_INITIALIZED;
4070
+ this._inputDeviceState = exports.InputDevicesState.NOT_INITIALIZED;
4071
4071
  this._cameraState = exports.DeviceState.NOT_INITIALIZED;
4072
4072
  this._microphoneState = exports.DeviceState.NOT_INITIALIZED;
4073
4073
  yield this.initializeDevices();
@@ -4080,7 +4080,7 @@
4080
4080
  }
4081
4081
  } catch (error) {
4082
4082
  this._logger.error(this, "Start failed: " + JSON.stringify(error));
4083
- this.setInputDeviceState(exports.StreamerState.INVALID);
4083
+ this.setInputDeviceState(exports.InputDevicesState.INVALID);
4084
4084
  throw error;
4085
4085
  }
4086
4086
  });
@@ -4579,8 +4579,8 @@
4579
4579
  constructor(streamConfig, autoInitialize = false) {
4580
4580
  super();
4581
4581
  this.DEV_MODE = true;
4582
- this.STREAMER_VERSION = "0.9.2-beta.0";
4583
- this.COMPILE_DATE = "3/6/2025, 12:46:45 PM";
4582
+ this.STREAMER_VERSION = "0.9.2-beta.1";
4583
+ this.COMPILE_DATE = "3/6/2025, 1:40:51 PM";
4584
4584
  this.STREAMER_BRANCH = "Experimental";
4585
4585
  this.STREAMER_PROTOCOL_VERSION = 1;
4586
4586
  this._initialized = false;
@@ -4724,9 +4724,9 @@
4724
4724
  var _a, _b;
4725
4725
  return (_b = (_a = this._streamerController) === null || _a === void 0 ? void 0 : _a.publish(streamKey)) !== null && _b !== void 0 ? _b : false;
4726
4726
  }
4727
- getInputDeviceState() {
4727
+ getInputDevicesState() {
4728
4728
  var _a, _b;
4729
- return (_b = (_a = this._streamerController) === null || _a === void 0 ? void 0 : _a.getInputDeviceState()) !== null && _b !== void 0 ? _b : exports.StreamerState.NOT_INITIALIZED;
4729
+ return (_b = (_a = this._streamerController) === null || _a === void 0 ? void 0 : _a.getInputDeviceState()) !== null && _b !== void 0 ? _b : exports.InputDevicesState.NOT_INITIALIZED;
4730
4730
  }
4731
4731
  getCamerState() {
4732
4732
  var _a, _b;