mediasfu-vue 1.2.2 → 1.3.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +42 -0
  3. package/dist/index.cjs +3376 -2624
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.js +3349 -2627
  6. package/dist/index.js.map +1 -1
  7. package/dist/mediasfu-vue.css +98 -98
  8. package/dist/types/ProducerClient/producerClientEmits/updateRoomParametersClient.d.ts +2 -0
  9. package/dist/types/SharedTypes/index.d.ts +16 -0
  10. package/dist/types/components/mediasfuComponents/MediasfuGeneric.vue.d.ts +16 -0
  11. package/dist/types/components/miscComponents/ScreenAudioPrompt.vue.d.ts +34 -0
  12. package/dist/types/components/miscComponents/index.d.ts +4 -0
  13. package/dist/types/components/miscComponents/promptScreenAudioChoice.d.ts +19 -0
  14. package/dist/types/index.d.ts +4 -0
  15. package/dist/types/methods/utils/ScreenAudioPlayer/ScreenAudioPlayer.vue.d.ts +43 -0
  16. package/dist/types/utils/waitForRoomAdmission.d.ts +44 -0
  17. package/package.json +3 -2
  18. package/src/ProducerClient/producerClientEmits/updateRoomParametersClient.ts +4 -0
  19. package/src/SharedTypes/index.ts +16 -0
  20. package/src/components/displayComponents/AudioCard.vue +1 -1
  21. package/src/components/displayComponents/VideoCard.vue +1 -1
  22. package/src/components/mediasfuComponents/MediasfuGeneric.vue +43 -2
  23. package/src/components/miscComponents/ScreenAudioPrompt.vue +359 -0
  24. package/src/components/miscComponents/index.ts +4 -0
  25. package/src/components/miscComponents/promptScreenAudioChoice.ts +49 -0
  26. package/src/components/participantsComponents/ParticipantListItem.vue +2 -2
  27. package/src/components/participantsComponents/ParticipantListOthersItem.vue +5 -5
  28. package/src/consumers/consumerResume.ts +43 -0
  29. package/src/index.ts +23 -0
  30. package/src/methods/utils/ScreenAudioPlayer/ScreenAudioPlayer.vue +194 -0
  31. package/src/modern/display_components/ModernAudioCard.vue +2 -2
  32. package/src/modern/display_components/ModernVideoCard.vue +1 -1
  33. package/src/modern/modal_components/ModernParticipantsModal.vue +6 -5
  34. package/src/utils/mediasfuRooms.ts +17 -1
  35. package/src/utils/waitForRoomAdmission.ts +125 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.1 — 2026-10-14
4
+
5
+ - Requires `mediasfu-shared` 1.3.2 or later.
6
+ - **Unmute in audio-only rooms.** The microphone could not be turned on in rooms created with `mediaType: "audio"` (it showed a camera message). Audio-only rooms now only block cameras.
7
+ - **Readable names.** Video and audio cards, participant lists and the join notice show a member's `displayName` when the room has one, falling back to the member name.
8
+ - **Waiting rooms for API rooms** in the room helper (`utils/mediasfuRooms.ts`): a guest waits until the host lets them in.
9
+ - New room-create options: `region` (`asia`, `europe`, `us`, `general`), `regionStrict` (refuse instead of placing the room in another region) and `waitRoom`. Servers that do not support them ignore them.
10
+
11
+ ## 1.3.0 — 2026-10-09
12
+
13
+ - **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.
14
+ - **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.
15
+ - **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.
16
+ - **No more silent microphones from a send-transport race.** When the microphone and camera start together (or a toggle overlaps a rejoin), only one send transport is created per connection; later requests wait for it and send their media on it. Previously the second request replaced the first on the media server and that participant's audio could be lost. Two produces of the same kind at the same moment now share one producer.
17
+ - Audio-only players are removed when their producer closes, so a rejoin never leaves a second player behind.
18
+ - Requires `mediasfu-shared` 1.3.0 or later.
19
+ - **A refused reconnect is final.** When a media server refuses a reconnect for good (the room ended, the credentials were replaced, no meeting minutes), the SDK closes that socket instead of letting Socket.IO retry it for as long as the page stays open. Temporary refusals still retry.
20
+
3
21
  ## 1.2.2 — 2026-09-30
4
22
 
5
23
  - Disable camera simulcast automatically for chat and capacity-two rooms, with an explicit `simulcastOff` opt-out for larger rooms and an optional `roomCapacity` hint.
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. |