@camera.ui/browser 0.0.174 → 0.0.175

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -10
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -3018,7 +3018,6 @@ var StreamConnection = class {
3018
3018
  containerElement;
3019
3019
  target;
3020
3020
  isReady;
3021
- effectiveMode;
3022
3021
  triedSourceIds = /* @__PURE__ */ new Set();
3023
3022
  options;
3024
3023
  wsTransport;
@@ -3078,10 +3077,6 @@ var StreamConnection = class {
3078
3077
  this.videoElement = computed(() => toValue(options.videoElement));
3079
3078
  this.containerElement = computed(() => toValue(options.containerElement));
3080
3079
  this.isReady = computed(() => !!this.camera.value && !!this.videoElement.value && !!this.target.value);
3081
- this.effectiveMode = computed(() => {
3082
- if (this.requestedMode.value === "auto") return this.activeMode.value;
3083
- return this.requestedMode.value;
3084
- });
3085
3080
  this.scope.run(() => {
3086
3081
  const { onTabPaused, onTabVisible } = useTabVisibility();
3087
3082
  const wsConnectTimeout = useTimeoutFn(() => {
@@ -3102,7 +3097,7 @@ var StreamConnection = class {
3102
3097
  this.markSourceUndecodable();
3103
3098
  this.restart();
3104
3099
  }
3105
- } else if (this.status.value === "connected" && !this.isPlaying.value && !this.abortController.signal.aborted && this.sourceLikelyH265()) this.handleNoFramesWhileConnected();
3100
+ } else if (this.status.value === "connected" && !this.isPlaying.value && !this.abortController.signal.aborted) this.handleNoFramesWhileConnected();
3106
3101
  }, STREAM_CONFIG.WEBRTC.CONNECT_TIMEOUT, { immediate: false });
3107
3102
  const mseConnectTimeout = useTimeoutFn(() => {
3108
3103
  if (this.abortController.signal.aborted || this.status.value === "connected" || this.status.value === "closed") return;
@@ -3532,7 +3527,15 @@ var StreamConnection = class {
3532
3527
  this.triedSourceIds.add(src._id);
3533
3528
  }
3534
3529
  handleNoFramesWhileConnected() {
3535
- reportH265DecodeFailure(this.activeMode.value === "mse" ? "mse" : "webrtc");
3530
+ if (this.sourceLikelyH265()) reportH265DecodeFailure(this.activeMode.value === "mse" ? "mse" : "webrtc");
3531
+ if (this.requestedMode.value === "auto" && this.activeMode.value !== "mse") {
3532
+ this.webrtcHandler?.close();
3533
+ this.webrtcHandler = void 0;
3534
+ this.activeMode.value = "mse";
3535
+ this.status.value = "reconnecting";
3536
+ this.startMSE();
3537
+ return;
3538
+ }
3536
3539
  this.markSourceUndecodable();
3537
3540
  this.restart();
3538
3541
  }
@@ -3589,10 +3592,10 @@ var StreamConnection = class {
3589
3592
  if (this.abortController.signal.aborted) return;
3590
3593
  this.stopWsConnectTimeout();
3591
3594
  this.status.value = "connecting";
3592
- const mode = this.effectiveMode.value;
3593
- if (mode === "webrtc" || mode === "webrtc/tcp") this.startWebRTC(mode);
3595
+ const mode = this.requestedMode.value;
3596
+ if (mode === "auto") this.startAutoMode();
3597
+ else if (mode === "webrtc" || mode === "webrtc/tcp") this.startWebRTC(mode);
3594
3598
  else if (mode === "mse") this.startMSE();
3595
- else if (this.requestedMode.value === "auto") this.startAutoMode();
3596
3599
  }
3597
3600
  handleWsClose() {
3598
3601
  if (this.status.value !== "closed" && !this.abortController.signal.aborted) this.startReconnectTimeout();
@@ -3652,6 +3655,10 @@ var StreamConnection = class {
3652
3655
  if (this.abortController.signal.aborted) return;
3653
3656
  const video = this.videoElement.value;
3654
3657
  if (!video) return;
3658
+ if (this.hasVideo.value && stream.getVideoTracks().length === 0) {
3659
+ this.handleWebRTCFailed();
3660
+ return;
3661
+ }
3655
3662
  this.activeMode.value = this.requestedMode.value === "auto" ? "webrtc" : this.requestedMode.value;
3656
3663
  this.lastMediaStream = stream;
3657
3664
  video.srcObject = stream;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.0.174",
3
+ "version": "0.0.175",
4
4
  "description": "camera.ui browser client",
5
5
  "author": "seydx (https://github.com/cameraui/clients)",
6
6
  "type": "module",
@@ -45,7 +45,7 @@
45
45
  "@microsoft/api-extractor": "^7.59.0",
46
46
  "@stylistic/eslint-plugin": "^5.10.0",
47
47
  "@types/webrtc": "^0.0.47",
48
- "@typescript-eslint/parser": "^8.67.0",
48
+ "@typescript-eslint/parser": "^8.68.0",
49
49
  "@vitejs/plugin-vue": "^6.0.8",
50
50
  "@vue/eslint-config-prettier": "^10.2.0",
51
51
  "@vue/eslint-config-typescript": "^14.9.0",
@@ -59,9 +59,9 @@
59
59
  "prettier": "^3.9.6",
60
60
  "rimraf": "^6.1.3",
61
61
  "typescript": "5.9.3",
62
- "typescript-eslint": "^8.67.0",
62
+ "typescript-eslint": "^8.68.0",
63
63
  "unplugin-dts": "^1.0.3",
64
- "updates": "^18.0.5",
64
+ "updates": "^18.0.6",
65
65
  "vite": "^8.2.2",
66
66
  "vitest": "^4.1.11",
67
67
  "vue": "^3.5.41",