mediasfu-vue 1.3.0 → 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.
- package/CHANGELOG.md +10 -0
- package/dist/index.cjs +127 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +127 -17
- package/dist/index.js.map +1 -1
- package/dist/mediasfu-vue.css +98 -98
- package/dist/types/SharedTypes/index.d.ts +12 -0
- package/dist/types/utils/waitForRoomAdmission.d.ts +44 -0
- package/package.json +2 -2
- package/src/SharedTypes/index.ts +12 -0
- package/src/components/displayComponents/AudioCard.vue +1 -1
- package/src/components/displayComponents/VideoCard.vue +1 -1
- package/src/components/mediasfuComponents/MediasfuGeneric.vue +3 -2
- package/src/components/participantsComponents/ParticipantListItem.vue +2 -2
- package/src/components/participantsComponents/ParticipantListOthersItem.vue +5 -5
- package/src/modern/display_components/ModernAudioCard.vue +2 -2
- package/src/modern/display_components/ModernVideoCard.vue +1 -1
- package/src/modern/modal_components/ModernParticipantsModal.vue +6 -5
- package/src/utils/mediasfuRooms.ts +17 -1
- package/src/utils/waitForRoomAdmission.ts +125 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
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
|
+
|
|
3
11
|
## 1.3.0 — 2026-10-09
|
|
4
12
|
|
|
5
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.
|
|
6
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.
|
|
7
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.
|
|
8
17
|
- Audio-only players are removed when their producer closes, so a rejoin never leaves a second player behind.
|
|
9
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.
|
|
10
20
|
|
|
11
21
|
## 1.2.2 — 2026-09-30
|
|
12
22
|
|
package/dist/index.cjs
CHANGED
|
@@ -6,6 +6,101 @@ const vueFontawesome = require("@fortawesome/vue-fontawesome");
|
|
|
6
6
|
const freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
7
7
|
const freeBrandsSvgIcons = require("@fortawesome/free-brands-svg-icons");
|
|
8
8
|
const SelfieSegmentationModule = require("@mediapipe/selfie_segmentation");
|
|
9
|
+
const WAITING_ROOM_DECLINED_MESSAGE = "The host didn't let you in.";
|
|
10
|
+
const WAITING_ROOM_ENDED_MESSAGE = "This room has ended.";
|
|
11
|
+
const WAITING_ROOM_UNSUPPORTED_MESSAGE = "This server does not support waiting rooms for API guests yet.";
|
|
12
|
+
const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
13
|
+
function announce(status, roomName) {
|
|
14
|
+
try {
|
|
15
|
+
if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof CustomEvent === "function") {
|
|
16
|
+
window.dispatchEvent(new CustomEvent("mediasfu:waiting-room", { detail: { status, roomName } }));
|
|
17
|
+
}
|
|
18
|
+
} catch {
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async function waitForRoomAdmission(options) {
|
|
22
|
+
const {
|
|
23
|
+
roomName,
|
|
24
|
+
userName,
|
|
25
|
+
secret,
|
|
26
|
+
apiUserName,
|
|
27
|
+
apiKey,
|
|
28
|
+
endpoint,
|
|
29
|
+
intervalMs = 3e3,
|
|
30
|
+
timeoutMs = 30 * 60 * 1e3,
|
|
31
|
+
signal,
|
|
32
|
+
onStatus
|
|
33
|
+
} = options;
|
|
34
|
+
const doFetch = options.fetchImpl || fetch;
|
|
35
|
+
const sleep = options.sleep || defaultSleep;
|
|
36
|
+
const now = options.now || Date.now;
|
|
37
|
+
const interval = Math.max(1e3, intervalMs);
|
|
38
|
+
const deadline = now() + timeoutMs;
|
|
39
|
+
let cancelled = false;
|
|
40
|
+
const onCancel = () => {
|
|
41
|
+
cancelled = true;
|
|
42
|
+
};
|
|
43
|
+
const hasWindow = typeof window !== "undefined" && typeof window.addEventListener === "function";
|
|
44
|
+
if (hasWindow) window.addEventListener("mediasfu:waiting-room-cancel", onCancel);
|
|
45
|
+
const report = (status) => {
|
|
46
|
+
announce(status, roomName);
|
|
47
|
+
try {
|
|
48
|
+
onStatus?.(status);
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const finish = (result) => {
|
|
53
|
+
if (hasWindow) window.removeEventListener("mediasfu:waiting-room-cancel", onCancel);
|
|
54
|
+
report(result.status);
|
|
55
|
+
return result;
|
|
56
|
+
};
|
|
57
|
+
report("waiting");
|
|
58
|
+
let failures = 0;
|
|
59
|
+
while (now() < deadline) {
|
|
60
|
+
if (cancelled || signal?.aborted) return finish({ status: "cancelled", error: "Stopped waiting for the host." });
|
|
61
|
+
await sleep(interval);
|
|
62
|
+
if (cancelled || signal?.aborted) return finish({ status: "cancelled", error: "Stopped waiting for the host." });
|
|
63
|
+
let httpStatus = 0;
|
|
64
|
+
let body = {};
|
|
65
|
+
try {
|
|
66
|
+
const response = await doFetch(endpoint, {
|
|
67
|
+
method: "POST",
|
|
68
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiUserName}:${apiKey}` },
|
|
69
|
+
body: JSON.stringify({ action: "waitStatus", meetingID: roomName, userName, secret })
|
|
70
|
+
});
|
|
71
|
+
httpStatus = response.status;
|
|
72
|
+
body = await response.json().catch(() => ({})) || {};
|
|
73
|
+
} catch {
|
|
74
|
+
failures += 1;
|
|
75
|
+
if (failures >= 10) return finish({ status: "error", error: "Lost contact with the server while waiting for the host." });
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const status = String(body.status || "");
|
|
79
|
+
if (status === "admitted" && typeof body.link === "string" && body.link) {
|
|
80
|
+
return finish({
|
|
81
|
+
status: "admitted",
|
|
82
|
+
data: {
|
|
83
|
+
roomName: String(body.roomName || roomName),
|
|
84
|
+
userName,
|
|
85
|
+
secret: String(body.secret || secret),
|
|
86
|
+
link: body.link,
|
|
87
|
+
publicURL: String(body.publicURL || "")
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (status === "declined" || httpStatus === 403) return finish({ status: "declined", error: WAITING_ROOM_DECLINED_MESSAGE });
|
|
92
|
+
if (status === "ended" || httpStatus === 410) return finish({ status: "ended", error: WAITING_ROOM_ENDED_MESSAGE });
|
|
93
|
+
if (httpStatus === 400) return finish({ status: "error", error: WAITING_ROOM_UNSUPPORTED_MESSAGE });
|
|
94
|
+
if (httpStatus === 401) return finish({ status: "error", error: String(body.error || "These room credentials are no longer valid.") });
|
|
95
|
+
if (status === "waiting" && httpStatus >= 200 && httpStatus < 300) {
|
|
96
|
+
failures = 0;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
failures += 1;
|
|
100
|
+
if (failures >= 10) return finish({ status: "error", error: String(body.error || "The server could not tell whether the host let you in.") });
|
|
101
|
+
}
|
|
102
|
+
return finish({ status: "timeout", error: "The host did not let you in within 30 minutes." });
|
|
103
|
+
}
|
|
9
104
|
const isCredentialInvalid = (apiUserName, apiKey) => {
|
|
10
105
|
return !apiUserName || !apiKey || apiUserName === "yourAPIUSERNAME" || apiKey === "yourAPIKEY" || apiKey.length !== 64 || apiUserName.length < 6;
|
|
11
106
|
};
|
|
@@ -135,7 +230,21 @@ const joinRoomOnMediaSFU = async ({
|
|
|
135
230
|
if (!response.ok) {
|
|
136
231
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
137
232
|
}
|
|
138
|
-
|
|
233
|
+
let data = await response.json();
|
|
234
|
+
if (data?.waiting === true && data?.secret) {
|
|
235
|
+
const admission = await waitForRoomAdmission({
|
|
236
|
+
roomName: data.roomName || payload.meetingID,
|
|
237
|
+
userName: data.userName || payload.userName,
|
|
238
|
+
secret: data.secret,
|
|
239
|
+
apiUserName,
|
|
240
|
+
apiKey,
|
|
241
|
+
endpoint: finalLink
|
|
242
|
+
});
|
|
243
|
+
if (admission.status !== "admitted" || !admission.data) {
|
|
244
|
+
return { data: { error: admission.error || WAITING_ROOM_DECLINED_MESSAGE }, success: false };
|
|
245
|
+
}
|
|
246
|
+
data = { ...data, ...admission.data, waiting: false, message: "Room joined successfully", success: true };
|
|
247
|
+
}
|
|
139
248
|
return { data, success: true };
|
|
140
249
|
} catch (error) {
|
|
141
250
|
const reason = error.message ?? "unknown error";
|
|
@@ -1362,7 +1471,7 @@ const _sfc_main$1Q = /* @__PURE__ */ vue.defineComponent({
|
|
|
1362
1471
|
vue.createElementVNode("div", { style: nameColumnStyle }, [
|
|
1363
1472
|
vue.createElementVNode("span", {
|
|
1364
1473
|
style: vue.normalizeStyle({ ...nameTextStyle, color: __props.textColor })
|
|
1365
|
-
}, vue.toDisplayString(__props.participant?.name), 5)
|
|
1474
|
+
}, vue.toDisplayString(__props.participant?.displayName || __props.participant?.name), 5)
|
|
1366
1475
|
]),
|
|
1367
1476
|
showWaveformState.value ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({ key: 0 }, waveformContainerRestAttrs.value, {
|
|
1368
1477
|
class: waveformContainerClassNames.value,
|
|
@@ -2257,7 +2366,7 @@ const _sfc_main$1O = /* @__PURE__ */ vue.defineComponent({
|
|
|
2257
2366
|
vue.createElementVNode("p", vue.mergeProps(nameTextRestAttrs.value, {
|
|
2258
2367
|
class: nameTextClassNames.value,
|
|
2259
2368
|
style: nameTextMergedStyle.value
|
|
2260
|
-
}), vue.toDisplayString(__props.name), 17)
|
|
2369
|
+
}), vue.toDisplayString(__props.participant?.displayName || __props.name), 17)
|
|
2261
2370
|
], 16),
|
|
2262
2371
|
showWaveformState.value ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({ key: 0 }, waveformContainerRestAttrs.value, {
|
|
2263
2372
|
class: waveformContainerClassNames.value,
|
|
@@ -11141,7 +11250,7 @@ const _sfc_main$1k = /* @__PURE__ */ vue.defineComponent({
|
|
|
11141
11250
|
return (_ctx, _cache) => {
|
|
11142
11251
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$p, [
|
|
11143
11252
|
vue.createElementVNode("div", _hoisted_2$k, [
|
|
11144
|
-
vue.createElementVNode("p", _hoisted_3$h, vue.toDisplayString(__props.participant.islevel === "2" ? `${__props.participant.name} (host)` : __props.participant.name), 1)
|
|
11253
|
+
vue.createElementVNode("p", _hoisted_3$h, vue.toDisplayString(__props.participant.islevel === "2" ? `${__props.participant.displayName || __props.participant.name} (host)` : __props.participant.displayName || __props.participant.name), 1)
|
|
11145
11254
|
]),
|
|
11146
11255
|
!__props.isBroadcast ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
11147
11256
|
vue.createElementVNode("div", _hoisted_4$g, [
|
|
@@ -11289,12 +11398,12 @@ const _sfc_main$1i = /* @__PURE__ */ vue.defineComponent({
|
|
|
11289
11398
|
const props = __props;
|
|
11290
11399
|
const displayName = vue.computed(() => {
|
|
11291
11400
|
if (props.participant.islevel === "2") {
|
|
11292
|
-
return props.participant.name === props.member ? `${props.participant.name} (you)` : `${props.participant.name} (host)`;
|
|
11401
|
+
return props.participant.name === props.member ? `${props.participant.displayName || props.participant.name} (you)` : `${props.participant.displayName || props.participant.name} (host)`;
|
|
11293
11402
|
} else {
|
|
11294
11403
|
if (props.participant.name === props.member) {
|
|
11295
|
-
return `${props.participant.name} (you)`;
|
|
11404
|
+
return `${props.participant.displayName || props.participant.name} (you)`;
|
|
11296
11405
|
}
|
|
11297
|
-
return props.coHost === props.participant.name ? `${props.participant.name} (co-host)` : props.participant.name;
|
|
11406
|
+
return props.coHost === props.participant.name ? `${props.participant.displayName || props.participant.name} (co-host)` : props.participant.displayName || props.participant.name;
|
|
11298
11407
|
}
|
|
11299
11408
|
});
|
|
11300
11409
|
const styles = {
|
|
@@ -30088,7 +30197,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
|
30088
30197
|
return allParticipants.value;
|
|
30089
30198
|
}
|
|
30090
30199
|
return allParticipants.value.filter(
|
|
30091
|
-
(participant) => participant.name?.toLowerCase().includes(trimmedQuery)
|
|
30200
|
+
(participant) => participant.name?.toLowerCase().includes(trimmedQuery) || participant.displayName?.toLowerCase().includes(trimmedQuery)
|
|
30092
30201
|
);
|
|
30093
30202
|
});
|
|
30094
30203
|
const isBroadcastEvent = vue.computed(() => currentParameters.value?.eventType === "broadcast");
|
|
@@ -30345,7 +30454,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
|
30345
30454
|
fontSize: "0.84rem",
|
|
30346
30455
|
flexShrink: 0
|
|
30347
30456
|
}
|
|
30348
|
-
}, getParticipantInitials(participant.name)),
|
|
30457
|
+
}, getParticipantInitials(participant.displayName || participant.name)),
|
|
30349
30458
|
vue.h("div", {
|
|
30350
30459
|
style: {
|
|
30351
30460
|
minWidth: 0,
|
|
@@ -30368,7 +30477,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
|
30368
30477
|
fontSize: "0.92rem",
|
|
30369
30478
|
overflowWrap: "anywhere"
|
|
30370
30479
|
}
|
|
30371
|
-
}, isHostParticipant(participant) ? `${participant.name} (host)` : participant.name),
|
|
30480
|
+
}, isHostParticipant(participant) ? `${participant.displayName || participant.name} (host)` : participant.displayName || participant.name),
|
|
30372
30481
|
isHostParticipant(participant) ? vue.h(vueFontawesome.FontAwesomeIcon, {
|
|
30373
30482
|
icon: freeSolidSvgIcons.faCrown,
|
|
30374
30483
|
style: { color: "#f59e0b", fontSize: "0.82rem" }
|
|
@@ -30575,7 +30684,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
|
30575
30684
|
};
|
|
30576
30685
|
}
|
|
30577
30686
|
});
|
|
30578
|
-
const ModernParticipantsModal = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-
|
|
30687
|
+
const ModernParticipantsModal = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-9f18fc5d"]]);
|
|
30579
30688
|
const panelGradientBackground$a = "linear-gradient(180deg, var(--ms-modern-panel-surface-elevated) 0%, var(--ms-modern-panel-surface) 100%)";
|
|
30580
30689
|
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
30581
30690
|
__name: "ModernPermissionsModal",
|
|
@@ -40637,9 +40746,10 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
40637
40746
|
updateTotalReqWait: (value) => totalReqWait.value = value
|
|
40638
40747
|
});
|
|
40639
40748
|
});
|
|
40640
|
-
socketDefault.on("personJoined", async ({ name }) => {
|
|
40749
|
+
socketDefault.on("personJoined", async ({ name, displayName }) => {
|
|
40641
40750
|
await mediasfuShared.personJoined({
|
|
40642
|
-
name,
|
|
40751
|
+
// The notice only displays this name, so the readable label (displayName) rides in it.
|
|
40752
|
+
name: displayName || participants.value.find((p) => p.name === name)?.displayName || name,
|
|
40643
40753
|
showAlert
|
|
40644
40754
|
});
|
|
40645
40755
|
});
|
|
@@ -41921,7 +42031,7 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
41921
42031
|
};
|
|
41922
42032
|
}
|
|
41923
42033
|
});
|
|
41924
|
-
const MediasfuGeneric = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-
|
|
42034
|
+
const MediasfuGeneric = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-545c61b9"]]);
|
|
41925
42035
|
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
41926
42036
|
__name: "MediasfuBroadcast",
|
|
41927
42037
|
props: {
|
|
@@ -43274,7 +43384,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
43274
43384
|
})) : vue.createCommentVNode("", true),
|
|
43275
43385
|
vue.createElementVNode("span", {
|
|
43276
43386
|
style: vue.normalizeStyle(nameStyle.value)
|
|
43277
|
-
}, vue.toDisplayString(__props.name), 5),
|
|
43387
|
+
}, vue.toDisplayString(__props.participant?.displayName || __props.name), 5),
|
|
43278
43388
|
vue.createElementVNode("div", vue.mergeProps(waveformContainerRestAttrs.value, {
|
|
43279
43389
|
class: waveformContainerClassNames.value,
|
|
43280
43390
|
style: waveformContainerStyle.value
|
|
@@ -44119,7 +44229,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
44119
44229
|
style: vue.normalizeStyle(avatarWrapperStyle.value)
|
|
44120
44230
|
}, [
|
|
44121
44231
|
vue.createVNode(_sfc_main$d, {
|
|
44122
|
-
initials: __props.name,
|
|
44232
|
+
initials: __props.participant?.displayName || __props.name,
|
|
44123
44233
|
"image-source": __props.imageSource,
|
|
44124
44234
|
"rounded-image": resolvedMiniCardProps.value.roundedImage,
|
|
44125
44235
|
"font-size": resolvedMiniCardProps.value.fontSize,
|
|
@@ -44142,7 +44252,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
44142
44252
|
})) : vue.createCommentVNode("", true),
|
|
44143
44253
|
vue.createElementVNode("span", {
|
|
44144
44254
|
style: vue.normalizeStyle(nameStyle.value)
|
|
44145
|
-
}, vue.toDisplayString(__props.name), 5),
|
|
44255
|
+
}, vue.toDisplayString(__props.participant?.displayName || __props.name), 5),
|
|
44146
44256
|
vue.createElementVNode("div", vue.mergeProps(waveformContainerRestAttrs.value, {
|
|
44147
44257
|
class: waveformContainerClassNames.value,
|
|
44148
44258
|
style: waveformContainerStyle.value
|