mediasfu-vue 1.2.1 → 1.3.0

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 (29) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +54 -0
  3. package/dist/index.cjs +2169 -1506
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.js +2137 -1504
  6. package/dist/index.js.map +1 -1
  7. package/dist/mediasfu-vue.css +83 -83
  8. package/dist/types/ProducerClient/producerClientEmits/roomVideoParams.d.ts +2 -0
  9. package/dist/types/ProducerClient/producerClientEmits/roomVideoPolicy.d.ts +19 -0
  10. package/dist/types/ProducerClient/producerClientEmits/updateRoomParametersClient.d.ts +11 -1
  11. package/dist/types/SharedTypes/index.d.ts +8 -0
  12. package/dist/types/components/mediasfuComponents/MediasfuGeneric.vue.d.ts +20 -0
  13. package/dist/types/components/miscComponents/ScreenAudioPrompt.vue.d.ts +34 -0
  14. package/dist/types/components/miscComponents/index.d.ts +4 -0
  15. package/dist/types/components/miscComponents/promptScreenAudioChoice.d.ts +19 -0
  16. package/dist/types/index.d.ts +4 -0
  17. package/dist/types/methods/utils/ScreenAudioPlayer/ScreenAudioPlayer.vue.d.ts +43 -0
  18. package/package.json +3 -2
  19. package/src/ProducerClient/producerClientEmits/roomVideoParams.ts +15 -0
  20. package/src/ProducerClient/producerClientEmits/roomVideoPolicy.ts +41 -0
  21. package/src/ProducerClient/producerClientEmits/updateRoomParametersClient.ts +22 -31
  22. package/src/SharedTypes/index.ts +8 -0
  23. package/src/components/mediasfuComponents/MediasfuGeneric.vue +46 -0
  24. package/src/components/miscComponents/ScreenAudioPrompt.vue +359 -0
  25. package/src/components/miscComponents/index.ts +4 -0
  26. package/src/components/miscComponents/promptScreenAudioChoice.ts +49 -0
  27. package/src/consumers/consumerResume.ts +43 -0
  28. package/src/index.ts +23 -0
  29. package/src/methods/utils/ScreenAudioPlayer/ScreenAudioPlayer.vue +194 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.0 — 2026-10-09
4
+
5
+ - **Screen-share audio.** Sharing a tab or screen in a Chromium desktop browser now offers **Screen + audio** or **Screen only**. The audio is published as its own track, pauses and stops with the share, and never marks the sharer as speaking. Listeners hear it with a "*name* · Screen audio" card they can mute for themselves. Configure with the `screenAudioMode` (`ask`, `always`, `never`), `screenAudioEnabled` and `screenAudioPrompt` props, or `updateScreenAudioMode` / `updateScreenAudioEnabled` on the room parameters; new exports include `ScreenAudioPrompt`, `promptScreenAudioChoice`, `ScreenAudioPlayer`, `connectSendTransportScreenAudio`, `toggleScreenAudio` and `setScreenAudioVolume`. Media servers without screen-audio support keep video-only sharing.
6
+ - **Consumer backup preference.** When a busy consuming node has a connected backup, new streams are taken from the backup when it announces them within 1.5 seconds; otherwise from the busy node as before.
7
+ - **Clear connection errors.** Join pages explain why a room could not be joined (credentials refused, no meeting minutes, offline, server unreachable) instead of a generic message. `connectSocket` rejects with `MediaSocketConnectError` (`phase`, `elapsedMs`, `online`, `reason`, `stage`, `retryable`), and `describeMediaSocketError` returns a user-facing sentence. A refused credential is not retried in a loop, and network failures no longer count toward the join attempt limit.
8
+ - Audio-only players are removed when their producer closes, so a rejoin never leaves a second player behind.
9
+ - Requires `mediasfu-shared` 1.3.0 or later.
10
+
11
+ ## 1.2.2 — 2026-09-30
12
+
13
+ - Disable camera simulcast automatically for chat and capacity-two rooms, with an explicit `simulcastOff` opt-out for larger rooms and an optional `roomCapacity` hint.
14
+ - Preserve full-resolution encoder limits in single-encoding mode and restore the original preset for later room updates.
15
+ - Remove the recording-only 20% camera bitrate and initial-bitrate uplift; screen-sharing and audio presets are unchanged.
16
+
17
+
3
18
  ## 1.2.0 — 2026-09-21
4
19
 
5
20
  - Added person-aware background blur to the classic and modern background modals.
package/README.md CHANGED
@@ -345,6 +345,46 @@ built-in planner. Save assignments before Start and show action errors in your
345
345
  page. Filtering tiles is not a breakout transition: the SDK must update room
346
346
  membership and pause/resume consumers for the participant's active room.
347
347
 
348
+ ## Screen-share audio
349
+
350
+ When someone shares a tab or screen in a Chromium desktop browser (Chrome, Edge,
351
+ Opera, Brave), the room asks **Share audio too?** with **Screen + audio** and
352
+ **Screen only**. The audio is published as its own track: everyone hears it,
353
+ listeners see a "*name* · Screen audio" card they can mute for themselves, and
354
+ the sharer is never shown as speaking because of it. It pauses and stops with
355
+ the screen share, and recordings include it. Firefox, Safari and mobile browsers
356
+ share video only, and media servers without screen-audio support keep
357
+ video-only screen sharing.
358
+
359
+ No setup is needed. To change the behaviour:
360
+
361
+ ```vue
362
+ <MediasfuGeneric screen-audio-mode="always" /> <!-- 'ask' (default) | 'always' | 'never' -->
363
+ <MediasfuGeneric :screen-audio-enabled="false" /> <!-- never request screen audio -->
364
+ ```
365
+
366
+ ```ts
367
+ import { toggleScreenAudio, setScreenAudioVolume } from 'mediasfu-vue';
368
+
369
+ toggleScreenAudio({ parameters: latestRoomParameters }); // sharer: mute/unmute screen audio, keep sharing
370
+ setScreenAudioVolume(0.5); // listener: screen-audio volume, 0..1
371
+ ```
372
+
373
+ Replace the dialog with your own by passing `screenAudioPrompt`, a function that
374
+ resolves `'audio'`, `'video'` (screen only) or `null` (cancel the share).
375
+
376
+ ## Connection errors
377
+
378
+ `connectSocket` rejects with a `MediaSocketConnectError` that says where the
379
+ connection stopped (`phase`: `before-open`, `after-open`, `rejected` or
380
+ `timeout`), how long it took (`elapsedMs`), the browser's `online` state and,
381
+ when the media server refused it, the `reason` and `stage`. The prebuilt join
382
+ pages already show a clear message, such as "The room did not accept these
383
+ credentials…" or "You appear to be offline…". In your own UI use
384
+ `describeMediaSocketError(error)`, and don't retry when `error.retryable` is
385
+ `false`: a refused credential will be refused again, so join the room again
386
+ through your backend to get fresh credentials.
387
+
348
388
  ## Host leave and rejoin
349
389
 
350
390
  Hosts can choose **Leave room** or **End for everyone**. **Leave room** keeps the room running so the host can rejoin later; **End for everyone** closes it for all participants. Programmatic callers pass `endRoomOnHostExit: false` to leave without ending the room; the default is `true`.
@@ -363,6 +403,8 @@ Hosts can choose **Leave room** or **End for everyone**. **Leave room** keeps th
363
403
  | What you see | Likely cause | What to do |
364
404
  |---|---|---|
365
405
  | "Unable to connect. Check your credentials and try again." | The room service rejected the credentials, or your create/join backend returned an error. | Check the API username and key on your server, and make sure your create/join adapters pass the room service's response through. For MediaSFU Open, confirm that `local-link` points to a server the browser can reach. |
406
+ | "The room did not accept these credentials…" | The media server refused the room credentials, often because the same name joined twice and the first secret was replaced. | Join the room again through your backend so it issues fresh credentials. Retrying the old ones will not succeed. |
407
+ | "You appear to be offline…" or "Could not reach the media server…" | The device has no connection, or a network, firewall or proxy blocked the media server. | Check the connection and firewall, then retry. These failures do not count toward the join attempt limit. |
366
408
  | The camera or microphone never starts | The page is not a secure context, or the browser permission was denied. | Serve the app over HTTPS (or `localhost` during development) and allow camera and microphone access for the site. |
367
409
  | "You must turn on your video before you can start recording" | The recording is set to capture video while your camera is off. | Turn the camera on first, or switch the recording to audio only. The same applies to audio recordings and the microphone. |
368
410
  | "You can only re-configure recording after pausing it" | Recording settings are locked while a recording is running. | Pause the recording, change the settings, then resume. |
@@ -391,3 +433,15 @@ Hosts can choose **Leave room** or **End for everyone**. **Leave room** keeps th
391
433
  ## License
392
434
 
393
435
  MIT. See [LICENSE](LICENSE).
436
+
437
+ ## Camera simulcast and recording bitrate
438
+
439
+ Camera simulcast is disabled automatically for `chat` rooms and rooms with a configured capacity of exactly two. This uses the room's configured capacity, not the number of participants currently connected. Larger rooms retain simulcast unless `simulcastOff: true` is supplied.
440
+
441
+ Single-encoding mode uses the full-resolution camera layer and preserves its bitrate and frame-rate limits. Screen-sharing and audio encodings are unchanged. Enabling recording no longer adds a 20% camera bitrate or initial-bitrate uplift.
442
+
443
+ The server's join-response `capacity` takes precedence. For servers that omit it, supply `roomCapacity: 2` as a client-side hint. Programmatic room creation also uses `noUIPreJoinOptions.capacity` as the hint. This option does not change server-side capacity or authorization.
444
+
445
+ ```vue
446
+ <MediasfuGeneric :simulcast-off="true" :room-capacity="2" />
447
+ ```