mediasfu-vue 1.0.5 β 1.0.6
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/README.md +39 -28
- package/dist/index.cjs +108 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.js +106 -121
- package/dist/index.js.map +1 -1
- package/dist/mediasfu-vue.css +93 -93
- package/package.json +8 -5
- package/src/App.vue +2 -3
- package/src/AppBroadcast.vue +2 -2
- package/src/AppChat.vue +2 -2
- package/src/AppConference.vue +2 -2
- package/src/AppGeneric.vue +2 -2
- package/src/AppWebinar.vue +2 -2
- package/src/components/backgroundComponents/BackgroundModal.vue +6 -3
- package/src/components/displayComponents/FlexibleVideo.vue +24 -45
- package/src/components/mediasfuComponents/MediasfuGeneric.vue +2 -3
- package/src/components/screenboardComponents/Screenboard.vue +24 -21
- package/src/components/screenboardComponents/canvasCoordinates.ts +58 -0
- package/src/examples/example-custom-components.vue +2 -2
- package/src/modern/display_components/ModernFlexibleVideo.vue +31 -54
- package/src/modern/modal_components/ModernBackgroundModal.vue +8 -5
- package/src/types/mediapipe.d.ts +6 -0
- package/src/utils/demoCloudConfig.ts +5 -6
- package/src/utils/mediasfuRooms.ts +1 -1
package/README.md
CHANGED
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
## Build real-time communication into Vue
|
|
47
47
|
|
|
48
|
-
MediaSFU Vue
|
|
48
|
+
MediaSFU Vue combines a Vue 3 WebRTC client, Composition API-friendly components, prebuilt room experiences, and lower-level customization APIs for video meetings, voice and video calls, webinars, interactive livestreams, chat, recording, screen sharing, whiteboards, polls, live captions, translation, and AI-assisted communication.
|
|
49
49
|
|
|
50
50
|
It is designed for teams that want to start with prebuilt room UI and then progressively customize or replace that UI without rebuilding the media runtime, signaling, or room orchestration from scratch.
|
|
51
51
|
|
|
@@ -56,6 +56,16 @@ It is designed for teams that want to start with prebuilt room UI and then progr
|
|
|
56
56
|
- Connect to MediaSFU Cloud or your self-hosted MediaSFU Open deployment.
|
|
57
57
|
- Use Vue 3 and Composition API-friendly wrappers without losing access to the broader MediaSFU product model.
|
|
58
58
|
|
|
59
|
+
### Common Vue product shapes
|
|
60
|
+
|
|
61
|
+
| You are building | Start with | Extend with |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| Team meetings or embedded video calls | `MediasfuGeneric` or `MediasfuConference` | branding, waiting rooms, screen sharing, annotation, recording |
|
|
64
|
+
| A webinar or virtual event | `MediasfuWebinar` | panelists, permissions, audience controls, polls |
|
|
65
|
+
| An interactive livestream or host-led broadcast | `MediasfuBroadcast` | custom host controls, layouts, recording |
|
|
66
|
+
| A support, community, or chat-first room | `MediasfuChat` | audio/video escalation, moderation, custom messages |
|
|
67
|
+
| A fully branded Vue collaboration workspace | `ModernMediasfuGeneric` or headless mode | `uiOverrides`, custom cards, `sourceParameters` |
|
|
68
|
+
|
|
59
69
|
## Quick Start: First Working Room
|
|
60
70
|
|
|
61
71
|
```bash
|
|
@@ -152,6 +162,24 @@ For demos without a backend connection, seed the UI locally:
|
|
|
152
162
|
</template>
|
|
153
163
|
```
|
|
154
164
|
|
|
165
|
+
## Common questions
|
|
166
|
+
|
|
167
|
+
### Is MediaSFU Vue only a UI component package?
|
|
168
|
+
|
|
169
|
+
No. It includes prebuilt Vue room UI and the browser-side WebRTC/session runtime. A MediaSFU-compatible backend still provides signaling, room lifecycle, and SFU media routing.
|
|
170
|
+
|
|
171
|
+
### Can I keep my existing Vue design system?
|
|
172
|
+
|
|
173
|
+
Yes. Replace targeted surfaces with `uiOverrides`, custom cards, and custom components, or use `:returnUI="false"` to place the runtime behind a completely custom Vue interface.
|
|
174
|
+
|
|
175
|
+
### Can I self-host MediaSFU?
|
|
176
|
+
|
|
177
|
+
Yes. Pass `localLink` for a MediaSFU Open deployment, or use MediaSFU Cloud when you prefer managed room and media infrastructure.
|
|
178
|
+
|
|
179
|
+
### Which collaboration features are included?
|
|
180
|
+
|
|
181
|
+
The SDK supports meeting, webinar, broadcast, and chat experiences with screen sharing and annotation, recording, whiteboards, polls, breakout rooms, live captions, translation, and extensible AI-agent workflows.
|
|
182
|
+
|
|
155
183
|
---
|
|
156
184
|
|
|
157
185
|
## Required: Import CSS Styles
|
|
@@ -168,24 +196,9 @@ This is required for all MediaSFU components to render with proper styling. With
|
|
|
168
196
|
|
|
169
197
|
---
|
|
170
198
|
|
|
171
|
-
##
|
|
172
|
-
|
|
173
|
-
MediaSFU also supports AI phone agents and telephony workflows on top of the same broader communications platform.
|
|
174
|
-
|
|
175
|
-
Call the live demos:
|
|
176
|
-
|
|
177
|
-
- πΊπΈ **+1 (785) 369-1724** - Mixed Support Demo
|
|
178
|
-
- π¬π§ **+44 7445 146575** - AI Conversation Demo
|
|
179
|
-
- π¨π¦ **+1 (587) 407-1990** - Technical Support Demo
|
|
180
|
-
- π¨π¦ **+1 (647) 558-6650** - Friendly AI Chat Demo
|
|
199
|
+
## Related MediaSFU capabilities: AI phone agents, SIP, and PSTN
|
|
181
200
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
- Deploy AI phone agents in about 30 minutes
|
|
185
|
-
- Works with SIP providers such as Twilio, Telnyx, and Zadarma
|
|
186
|
-
- Supports AI-to-human handoffs, analytics, and transcription
|
|
187
|
-
|
|
188
|
-
π **[Complete SIP/PSTN Documentation β](https://mediasfu.com/telephony)**
|
|
201
|
+
The wider MediaSFU platform also supports SIP/PSTN calling and AI phone-agent workflows, including provider integrations, human handoff, analytics, and transcription. These services are separate from the Vue browser SDK but can complement the same communication product. See the [MediaSFU telephony documentation](https://mediasfu.com/telephony).
|
|
189
202
|
|
|
190
203
|
---
|
|
191
204
|
|
|
@@ -283,12 +296,12 @@ const connectionPresets = computed(() => ({
|
|
|
283
296
|
},
|
|
284
297
|
hybrid: {
|
|
285
298
|
credentials,
|
|
286
|
-
localLink: '
|
|
299
|
+
localLink: 'https://your-mediasfu-server.example.com',
|
|
287
300
|
connectMediaSFU: true,
|
|
288
301
|
},
|
|
289
302
|
ce: {
|
|
290
303
|
credentials: undefined,
|
|
291
|
-
localLink: '
|
|
304
|
+
localLink: 'https://your-mediasfu-server.example.com',
|
|
292
305
|
connectMediaSFU: false,
|
|
293
306
|
},
|
|
294
307
|
}));
|
|
@@ -2646,7 +2659,7 @@ export type PreJoinPageType = (options: PreJoinPageOptions) => Vue.JSX.Element;
|
|
|
2646
2659
|
* userName: "Prince",
|
|
2647
2660
|
* }}
|
|
2648
2661
|
* connectMediaSFU={true}
|
|
2649
|
-
* localLink="
|
|
2662
|
+
* localLink="https://your-mediasfu-server.example.com"
|
|
2650
2663
|
* />
|
|
2651
2664
|
* );
|
|
2652
2665
|
* };
|
|
@@ -3143,7 +3156,7 @@ const App = () => {
|
|
|
3143
3156
|
// Example:
|
|
3144
3157
|
/*
|
|
3145
3158
|
const credentials = {};
|
|
3146
|
-
const localLink = '
|
|
3159
|
+
const localLink = 'https://your-mediasfu-server.example.com';
|
|
3147
3160
|
const connectMediaSFU = localLink.trim() !== '';
|
|
3148
3161
|
*/
|
|
3149
3162
|
|
|
@@ -3155,7 +3168,7 @@ const App = () => {
|
|
|
3155
3168
|
apiUserName: 'dummyUsr',
|
|
3156
3169
|
apiKey: '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
3157
3170
|
};
|
|
3158
|
-
const localLink = '
|
|
3171
|
+
const localLink = 'https://your-mediasfu-server.example.com';
|
|
3159
3172
|
const connectMediaSFU = localLink.trim() !== '';
|
|
3160
3173
|
*/
|
|
3161
3174
|
|
|
@@ -3373,7 +3386,7 @@ const App = () => {
|
|
|
3373
3386
|
// Example:
|
|
3374
3387
|
/*
|
|
3375
3388
|
const credentials = {};
|
|
3376
|
-
const localLink = '
|
|
3389
|
+
const localLink = 'https://your-mediasfu-server.example.com';
|
|
3377
3390
|
const connectMediaSFU = localLink.trim() !== '';
|
|
3378
3391
|
*/
|
|
3379
3392
|
|
|
@@ -3385,7 +3398,7 @@ const App = () => {
|
|
|
3385
3398
|
apiUserName: 'dummyUsr',
|
|
3386
3399
|
apiKey: '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
3387
3400
|
};
|
|
3388
|
-
const localLink = '
|
|
3401
|
+
const localLink = 'https://your-mediasfu-server.example.com';
|
|
3389
3402
|
const connectMediaSFU = localLink.trim() !== '';
|
|
3390
3403
|
*/
|
|
3391
3404
|
|
|
@@ -5244,5 +5257,3 @@ If you need further assistance or have any questions, feel free to ask!
|
|
|
5244
5257
|
MIT Β© [MediaSFU](https://www.mediasfu.com)
|
|
5245
5258
|
|
|
5246
5259
|
|
|
5247
|
-
|
|
5248
|
-
|
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const vue = require("vue");
|
|
|
5
5
|
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
|
-
const
|
|
8
|
+
const SelfieSegmentationModule = require("@mediapipe/selfie_segmentation");
|
|
9
9
|
const isCredentialInvalid = (apiUserName, apiKey) => {
|
|
10
10
|
return !apiUserName || !apiKey || apiUserName === "yourAPIUSERNAME" || apiKey === "yourAPIKEY" || apiKey.length !== 64 || apiUserName.length < 6;
|
|
11
11
|
};
|
|
@@ -10216,7 +10216,7 @@ const _hoisted_7$e = { class: "ms-permissions-modal__capability-list" };
|
|
|
10216
10216
|
const _hoisted_8$d = { class: "ms-permissions-modal__capability-meta" };
|
|
10217
10217
|
const _hoisted_9$c = ["value", "disabled", "onChange"];
|
|
10218
10218
|
const _hoisted_10$b = ["value"];
|
|
10219
|
-
const _hoisted_11$
|
|
10219
|
+
const _hoisted_11$9 = { class: "ms-permissions-modal__actions-row" };
|
|
10220
10220
|
const _hoisted_12$9 = { class: "ms-permissions-modal__users-toolbar" };
|
|
10221
10221
|
const _hoisted_13$8 = { class: "ms-permissions-modal__bulk-actions" };
|
|
10222
10222
|
const _hoisted_14$7 = { class: "ms-permissions-modal__participants-summary" };
|
|
@@ -10758,7 +10758,7 @@ const _sfc_main$1j = /* @__PURE__ */ vue.defineComponent({
|
|
|
10758
10758
|
]);
|
|
10759
10759
|
}), 64))
|
|
10760
10760
|
]),
|
|
10761
|
-
vue.createElementVNode("div", _hoisted_11$
|
|
10761
|
+
vue.createElementVNode("div", _hoisted_11$9, [
|
|
10762
10762
|
vue.createElementVNode("button", vue.mergeProps(resolveActionButtonProps("primary", !isHost.value || isSavingConfig.value), { onClick: handleSaveConfig }), vue.toDisplayString(isSavingConfig.value ? "Saving..." : "Save permission rules"), 17)
|
|
10763
10763
|
])
|
|
10764
10764
|
], 16)) : (vue.openBlock(), vue.createElementBlock("section", vue.normalizeProps(vue.mergeProps({ key: 1 }, mergedUsersSectionProps.value)), [
|
|
@@ -11542,7 +11542,7 @@ const _hoisted_7$c = { class: "ms-panelists-modal__checkbox-row" };
|
|
|
11542
11542
|
const _hoisted_8$c = ["disabled"];
|
|
11543
11543
|
const _hoisted_9$b = { class: "ms-panelists-modal__checkbox-row" };
|
|
11544
11544
|
const _hoisted_10$a = ["disabled"];
|
|
11545
|
-
const _hoisted_11$
|
|
11545
|
+
const _hoisted_11$8 = { class: "ms-panelists-modal__focus-actions" };
|
|
11546
11546
|
const _hoisted_12$8 = {
|
|
11547
11547
|
key: 0,
|
|
11548
11548
|
class: "ms-panelists-modal__helper-text"
|
|
@@ -11981,7 +11981,7 @@ const _sfc_main$1d = /* @__PURE__ */ vue.defineComponent({
|
|
|
11981
11981
|
_cache[6] || (_cache[6] = vue.createElementVNode("span", null, "Mute others' cameras", -1))
|
|
11982
11982
|
])
|
|
11983
11983
|
]),
|
|
11984
|
-
vue.createElementVNode("div", _hoisted_11$
|
|
11984
|
+
vue.createElementVNode("div", _hoisted_11$8, [
|
|
11985
11985
|
vue.createElementVNode("button", vue.mergeProps(resolveActionButtonProps(isFocused.value ? "secondary" : "primary", !isHost.value || isUpdatingFocus.value), { onClick: handleToggleFocus }), vue.toDisplayString(focusButtonLabel.value), 17),
|
|
11986
11986
|
!isHost.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_12$8, " Only the host can update panelists or change focus mode. ")) : vue.createCommentVNode("", true)
|
|
11987
11987
|
])
|
|
@@ -12073,7 +12073,7 @@ const _hoisted_7$b = { key: 1 };
|
|
|
12073
12073
|
const _hoisted_8$b = { class: "ms-translation-modal__card" };
|
|
12074
12074
|
const _hoisted_9$a = { class: "ms-translation-modal__section-heading" };
|
|
12075
12075
|
const _hoisted_10$9 = { class: "ms-translation-modal__toggle-row" };
|
|
12076
|
-
const _hoisted_11$
|
|
12076
|
+
const _hoisted_11$7 = ["disabled"];
|
|
12077
12077
|
const _hoisted_12$7 = {
|
|
12078
12078
|
key: 0,
|
|
12079
12079
|
class: "ms-translation-modal__personal-banner"
|
|
@@ -12753,7 +12753,7 @@ const _sfc_main$1c = /* @__PURE__ */ vue.defineComponent({
|
|
|
12753
12753
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => localSpokenEnabled.value = $event),
|
|
12754
12754
|
type: "checkbox",
|
|
12755
12755
|
disabled: !canChangeSpokenLanguage.value || isSaving.value
|
|
12756
|
-
}, null, 8, _hoisted_11$
|
|
12756
|
+
}, null, 8, _hoisted_11$7), [
|
|
12757
12757
|
[vue.vModelCheckbox, localSpokenEnabled.value]
|
|
12758
12758
|
]),
|
|
12759
12759
|
_cache[9] || (_cache[9] = vue.createElementVNode("span", null, "Enable spoken translation", -1))
|
|
@@ -17503,6 +17503,7 @@ const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
|
|
|
17503
17503
|
renderContent: { type: Function, default: void 0 }
|
|
17504
17504
|
},
|
|
17505
17505
|
setup(__props) {
|
|
17506
|
+
const { SelfieSegmentation } = SelfieSegmentationModule;
|
|
17506
17507
|
const props = __props;
|
|
17507
17508
|
const customImage = vue.ref(props.parameters.customImage ?? "");
|
|
17508
17509
|
const selectedImage = vue.ref(props.parameters.selectedImage ?? "");
|
|
@@ -17833,7 +17834,7 @@ const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
|
|
|
17833
17834
|
ctx.drawImage(img, 0, 0);
|
|
17834
17835
|
};
|
|
17835
17836
|
const preloadModel = async () => {
|
|
17836
|
-
const segmentation = new
|
|
17837
|
+
const segmentation = new SelfieSegmentation({
|
|
17837
17838
|
locateFile: (file) => `https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation/${file}`
|
|
17838
17839
|
});
|
|
17839
17840
|
segmentation.setOptions({
|
|
@@ -18731,7 +18732,7 @@ const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
|
|
|
18731
18732
|
};
|
|
18732
18733
|
}
|
|
18733
18734
|
});
|
|
18734
|
-
const BackgroundModal = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-
|
|
18735
|
+
const BackgroundModal = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-92701d78"]]);
|
|
18735
18736
|
const _hoisted_1$d = { class: "card-header" };
|
|
18736
18737
|
const _hoisted_2$b = { class: "room-title" };
|
|
18737
18738
|
const _hoisted_3$a = { class: "room-actions" };
|
|
@@ -20360,7 +20361,7 @@ const _hoisted_10$7 = {
|
|
|
20360
20361
|
key: 0,
|
|
20361
20362
|
class: "dropdown-menu show"
|
|
20362
20363
|
};
|
|
20363
|
-
const _hoisted_11$
|
|
20364
|
+
const _hoisted_11$6 = ["onClick"];
|
|
20364
20365
|
const _hoisted_12$6 = ["src"];
|
|
20365
20366
|
const _hoisted_13$5 = {
|
|
20366
20367
|
class: "btn-group",
|
|
@@ -22074,7 +22075,7 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
|
22074
22075
|
alt: "Shape",
|
|
22075
22076
|
class: "shape-icon"
|
|
22076
22077
|
}, null, 8, _hoisted_12$6)) : vue.createCommentVNode("", true)
|
|
22077
|
-
], 8, _hoisted_11$
|
|
22078
|
+
], 8, _hoisted_11$6);
|
|
22078
22079
|
}), 64))
|
|
22079
22080
|
])) : vue.createCommentVNode("", true)
|
|
22080
22081
|
]),
|
|
@@ -22283,6 +22284,32 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
|
22283
22284
|
}
|
|
22284
22285
|
});
|
|
22285
22286
|
const ClassicWhiteboard = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-ce0a4a38"]]);
|
|
22287
|
+
const getContainedContentRect = (containerWidth, containerHeight, sourceWidth, sourceHeight) => {
|
|
22288
|
+
const safeWidth = Math.max(containerWidth, 0);
|
|
22289
|
+
const safeHeight = Math.max(containerHeight, 0);
|
|
22290
|
+
if (safeWidth === 0 || safeHeight === 0 || sourceWidth <= 0 || sourceHeight <= 0) {
|
|
22291
|
+
return { left: 0, top: 0, width: safeWidth, height: safeHeight };
|
|
22292
|
+
}
|
|
22293
|
+
const scale = Math.min(safeWidth / sourceWidth, safeHeight / sourceHeight);
|
|
22294
|
+
const width = sourceWidth * scale;
|
|
22295
|
+
const height = sourceHeight * scale;
|
|
22296
|
+
return {
|
|
22297
|
+
left: (safeWidth - width) / 2,
|
|
22298
|
+
top: (safeHeight - height) / 2,
|
|
22299
|
+
width,
|
|
22300
|
+
height
|
|
22301
|
+
};
|
|
22302
|
+
};
|
|
22303
|
+
const getCanvasPoint = (event, canvas) => {
|
|
22304
|
+
const rect = canvas.getBoundingClientRect();
|
|
22305
|
+
if (rect.width <= 0 || rect.height <= 0) {
|
|
22306
|
+
return { x: event.offsetX, y: event.offsetY };
|
|
22307
|
+
}
|
|
22308
|
+
return {
|
|
22309
|
+
x: (event.clientX - rect.left) * (canvas.width / rect.width),
|
|
22310
|
+
y: (event.clientY - rect.top) * (canvas.height / rect.height)
|
|
22311
|
+
};
|
|
22312
|
+
};
|
|
22286
22313
|
const _hoisted_1$a = {
|
|
22287
22314
|
class: "btn-group",
|
|
22288
22315
|
role: "group"
|
|
@@ -22309,7 +22336,6 @@ const _hoisted_10$6 = {
|
|
|
22309
22336
|
class: "btn btnBoard btn-success",
|
|
22310
22337
|
style: { display: "none" }
|
|
22311
22338
|
};
|
|
22312
|
-
const _hoisted_11$6 = ["width", "height"];
|
|
22313
22339
|
const __default__ = {
|
|
22314
22340
|
name: "Screenboard"
|
|
22315
22341
|
};
|
|
@@ -22430,20 +22456,21 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
|
22430
22456
|
}
|
|
22431
22457
|
};
|
|
22432
22458
|
const startDrawing = (e) => {
|
|
22433
|
-
if (!ctx) return;
|
|
22459
|
+
if (!ctx || !canvasRef.value) return;
|
|
22460
|
+
const point = getCanvasPoint(e, canvasRef.value);
|
|
22434
22461
|
isDrawing.value = true;
|
|
22435
|
-
startX.value =
|
|
22436
|
-
startY.value =
|
|
22462
|
+
startX.value = point.x;
|
|
22463
|
+
startY.value = point.y;
|
|
22437
22464
|
if (mode.value === "erase") {
|
|
22438
|
-
erase(
|
|
22465
|
+
erase(point.x, point.y);
|
|
22439
22466
|
} else if (mode.value === "draw" || mode.value === "freehand") {
|
|
22440
22467
|
ctx.beginPath();
|
|
22441
|
-
ctx.moveTo(
|
|
22468
|
+
ctx.moveTo(point.x, point.y);
|
|
22442
22469
|
if (mode.value === "freehand") {
|
|
22443
22470
|
freehandDrawing.value = [
|
|
22444
22471
|
{
|
|
22445
|
-
x:
|
|
22446
|
-
y:
|
|
22472
|
+
x: point.x,
|
|
22473
|
+
y: point.y,
|
|
22447
22474
|
color: color.value,
|
|
22448
22475
|
thickness: brushThickness.value
|
|
22449
22476
|
}
|
|
@@ -22452,31 +22479,32 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
|
22452
22479
|
}
|
|
22453
22480
|
};
|
|
22454
22481
|
const draw = (e) => {
|
|
22455
|
-
if (!ctx || !isDrawing.value) return;
|
|
22456
|
-
|
|
22457
|
-
|
|
22482
|
+
if (!ctx || !canvasRef.value || !isDrawing.value) return;
|
|
22483
|
+
const point = getCanvasPoint(e, canvasRef.value);
|
|
22484
|
+
currentX.value = point.x;
|
|
22485
|
+
currentY.value = point.y;
|
|
22458
22486
|
if (mode.value === "erase") {
|
|
22459
|
-
erase(
|
|
22487
|
+
erase(point.x, point.y);
|
|
22460
22488
|
} else if (mode.value === "draw") {
|
|
22461
22489
|
ctx.clearRect(0, 0, canvas?.width ?? 0, canvas?.height ?? 0);
|
|
22462
22490
|
drawShapes();
|
|
22463
22491
|
drawLine(
|
|
22464
22492
|
startX.value,
|
|
22465
22493
|
startY.value,
|
|
22466
|
-
|
|
22467
|
-
|
|
22494
|
+
point.x,
|
|
22495
|
+
point.y,
|
|
22468
22496
|
color.value,
|
|
22469
22497
|
lineThickness.value,
|
|
22470
22498
|
lineType.value
|
|
22471
22499
|
);
|
|
22472
22500
|
} else if (mode.value === "freehand") {
|
|
22473
|
-
ctx.lineTo(
|
|
22501
|
+
ctx.lineTo(point.x, point.y);
|
|
22474
22502
|
ctx.strokeStyle = color.value;
|
|
22475
22503
|
ctx.lineWidth = brushThickness.value;
|
|
22476
22504
|
ctx.stroke();
|
|
22477
22505
|
freehandDrawing.value.push({
|
|
22478
|
-
x:
|
|
22479
|
-
y:
|
|
22506
|
+
x: point.x,
|
|
22507
|
+
y: point.y,
|
|
22480
22508
|
color: color.value,
|
|
22481
22509
|
thickness: brushThickness.value
|
|
22482
22510
|
});
|
|
@@ -22488,8 +22516,8 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
|
22488
22516
|
shape.value,
|
|
22489
22517
|
startX.value,
|
|
22490
22518
|
startY.value,
|
|
22491
|
-
|
|
22492
|
-
|
|
22519
|
+
point.x,
|
|
22520
|
+
point.y,
|
|
22493
22521
|
color.value,
|
|
22494
22522
|
lineThickness.value,
|
|
22495
22523
|
lineType.value
|
|
@@ -22848,7 +22876,7 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
|
22848
22876
|
height: "100%",
|
|
22849
22877
|
maxWidth: "100%",
|
|
22850
22878
|
maxHeight: "100%",
|
|
22851
|
-
overflow: "
|
|
22879
|
+
overflow: "hidden"
|
|
22852
22880
|
})
|
|
22853
22881
|
}, [
|
|
22854
22882
|
vue.createElementVNode("div", {
|
|
@@ -23041,8 +23069,8 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
|
23041
23069
|
id: "screenboardCanvas",
|
|
23042
23070
|
ref_key: "canvasRef",
|
|
23043
23071
|
ref: canvasRef,
|
|
23044
|
-
width:
|
|
23045
|
-
height:
|
|
23072
|
+
width: "1280",
|
|
23073
|
+
height: "720",
|
|
23046
23074
|
style: vue.normalizeStyle({
|
|
23047
23075
|
position: "absolute",
|
|
23048
23076
|
top: 0,
|
|
@@ -23055,7 +23083,7 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
|
23055
23083
|
margin: 0,
|
|
23056
23084
|
display: annotateScreenStream.value ? "block" : "none"
|
|
23057
23085
|
})
|
|
23058
|
-
}, null,
|
|
23086
|
+
}, null, 4)
|
|
23059
23087
|
], 4)
|
|
23060
23088
|
], 4);
|
|
23061
23089
|
};
|
|
@@ -24094,10 +24122,6 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
24094
24122
|
},
|
|
24095
24123
|
setup(__props) {
|
|
24096
24124
|
const props = __props;
|
|
24097
|
-
const cardWidth = vue.ref(0);
|
|
24098
|
-
const cardHeight = vue.ref(0);
|
|
24099
|
-
const cardLeft = vue.ref(0);
|
|
24100
|
-
const canvasLeft = vue.ref(0);
|
|
24101
24125
|
const slots = vue.useSlots();
|
|
24102
24126
|
const RenderVNode = vue.defineComponent({
|
|
24103
24127
|
name: "RenderVNode",
|
|
@@ -24130,36 +24154,16 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
24130
24154
|
const filtered = result.join(" ").trim();
|
|
24131
24155
|
return filtered.length > 0 ? filtered : void 0;
|
|
24132
24156
|
}
|
|
24133
|
-
vue.
|
|
24134
|
-
[
|
|
24135
|
-
|
|
24136
|
-
|
|
24137
|
-
|
|
24138
|
-
|
|
24139
|
-
|
|
24140
|
-
|
|
24141
|
-
|
|
24142
|
-
|
|
24143
|
-
const videoTrack = localStream.getVideoTracks()[0];
|
|
24144
|
-
if (videoTrack) {
|
|
24145
|
-
const settings = videoTrack.getSettings();
|
|
24146
|
-
const videoHeight = settings.height || 0;
|
|
24147
|
-
const videoWidth = settings.width || 0;
|
|
24148
|
-
cardWidth.value = videoWidth;
|
|
24149
|
-
cardHeight.value = videoHeight;
|
|
24150
|
-
const computedLeft = Math.floor((props.customWidth - videoWidth) / 2);
|
|
24151
|
-
cardLeft.value = computedLeft;
|
|
24152
|
-
canvasLeft.value = computedLeft < 0 ? computedLeft : 0;
|
|
24153
|
-
}
|
|
24154
|
-
} else {
|
|
24155
|
-
cardWidth.value = props.customWidth;
|
|
24156
|
-
cardHeight.value = props.customHeight;
|
|
24157
|
-
cardLeft.value = 0;
|
|
24158
|
-
canvasLeft.value = 0;
|
|
24159
|
-
}
|
|
24160
|
-
},
|
|
24161
|
-
{ immediate: true }
|
|
24162
|
-
);
|
|
24157
|
+
const screenContentRect = vue.computed(() => {
|
|
24158
|
+
const videoTrack = props.annotateScreenStream ? props.localStreamScreen?.getVideoTracks()[0] : void 0;
|
|
24159
|
+
const { width = 0, height = 0 } = videoTrack?.getSettings() ?? {};
|
|
24160
|
+
return getContainedContentRect(
|
|
24161
|
+
props.customWidth,
|
|
24162
|
+
props.customHeight,
|
|
24163
|
+
width,
|
|
24164
|
+
height
|
|
24165
|
+
);
|
|
24166
|
+
});
|
|
24163
24167
|
const containerRestAttrs = vue.computed(() => {
|
|
24164
24168
|
const { class: _class, style: _style, ...rest } = props.containerProps || {};
|
|
24165
24169
|
return rest;
|
|
@@ -24187,7 +24191,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
24187
24191
|
overflowX: "hidden",
|
|
24188
24192
|
overflowY: "hidden",
|
|
24189
24193
|
boxSizing: "border-box",
|
|
24190
|
-
left:
|
|
24194
|
+
left: 0,
|
|
24191
24195
|
...typeof props.containerProps?.style === "object" ? props.containerProps.style : {}
|
|
24192
24196
|
};
|
|
24193
24197
|
});
|
|
@@ -24215,8 +24219,8 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
24215
24219
|
() => joinClassNames("mediasfu-flexible-video__cell", props.cellProps?.class)
|
|
24216
24220
|
);
|
|
24217
24221
|
const cellStyle = vue.computed(() => {
|
|
24218
|
-
const widthPx = `${
|
|
24219
|
-
const heightPx = `${
|
|
24222
|
+
const widthPx = `${props.customWidth}px`;
|
|
24223
|
+
const heightPx = `${props.customHeight}px`;
|
|
24220
24224
|
return {
|
|
24221
24225
|
flex: 1,
|
|
24222
24226
|
width: widthPx,
|
|
@@ -24231,6 +24235,8 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
24231
24235
|
padding: 0,
|
|
24232
24236
|
borderRadius: "0px",
|
|
24233
24237
|
boxSizing: "border-box",
|
|
24238
|
+
position: "relative",
|
|
24239
|
+
left: 0,
|
|
24234
24240
|
...typeof props.cellProps?.style === "object" ? props.cellProps.style : {}
|
|
24235
24241
|
};
|
|
24236
24242
|
});
|
|
@@ -24294,12 +24300,13 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
24294
24300
|
() => joinClassNames("mediasfu-flexible-video__screenboard", props.screenboardContainerProps?.class)
|
|
24295
24301
|
);
|
|
24296
24302
|
const screenboardStyle = vue.computed(() => {
|
|
24297
|
-
const
|
|
24298
|
-
const
|
|
24303
|
+
const rect = screenContentRect.value;
|
|
24304
|
+
const widthPx = `${rect.width}px`;
|
|
24305
|
+
const heightPx = `${rect.height}px`;
|
|
24299
24306
|
return {
|
|
24300
24307
|
position: "absolute",
|
|
24301
|
-
top:
|
|
24302
|
-
left: `${
|
|
24308
|
+
top: `${rect.top}px`,
|
|
24309
|
+
left: `${rect.left}px`,
|
|
24303
24310
|
width: widthPx,
|
|
24304
24311
|
minWidth: widthPx,
|
|
24305
24312
|
maxWidth: widthPx,
|
|
@@ -41129,7 +41136,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
|
41129
41136
|
};
|
|
41130
41137
|
}
|
|
41131
41138
|
});
|
|
41132
|
-
const MediasfuGeneric = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-
|
|
41139
|
+
const MediasfuGeneric = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-1a72c1d0"]]);
|
|
41133
41140
|
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
41134
41141
|
__name: "MediasfuBroadcast",
|
|
41135
41142
|
props: {
|
|
@@ -43665,39 +43672,16 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
43665
43672
|
});
|
|
43666
43673
|
const props = __props;
|
|
43667
43674
|
const slots = vue.useSlots();
|
|
43668
|
-
const
|
|
43669
|
-
|
|
43670
|
-
|
|
43671
|
-
|
|
43672
|
-
|
|
43673
|
-
|
|
43674
|
-
|
|
43675
|
-
|
|
43676
|
-
|
|
43677
|
-
|
|
43678
|
-
],
|
|
43679
|
-
() => {
|
|
43680
|
-
if (props.annotateScreenStream && props.localStreamScreen) {
|
|
43681
|
-
const videoTrack = props.localStreamScreen.getVideoTracks()[0];
|
|
43682
|
-
if (videoTrack) {
|
|
43683
|
-
const settings = videoTrack.getSettings();
|
|
43684
|
-
const videoHeight = settings.height || 0;
|
|
43685
|
-
const videoWidth = settings.width || 0;
|
|
43686
|
-
cardWidth.value = videoWidth;
|
|
43687
|
-
cardHeight.value = videoHeight;
|
|
43688
|
-
const computedLeft = Math.floor((props.customWidth - videoWidth) / 2);
|
|
43689
|
-
cardLeft.value = computedLeft;
|
|
43690
|
-
canvasLeft.value = computedLeft < 0 ? computedLeft : 0;
|
|
43691
|
-
return;
|
|
43692
|
-
}
|
|
43693
|
-
}
|
|
43694
|
-
cardWidth.value = props.customWidth;
|
|
43695
|
-
cardHeight.value = props.customHeight;
|
|
43696
|
-
cardLeft.value = 0;
|
|
43697
|
-
canvasLeft.value = 0;
|
|
43698
|
-
},
|
|
43699
|
-
{ immediate: true }
|
|
43700
|
-
);
|
|
43675
|
+
const screenContentRect = vue.computed(() => {
|
|
43676
|
+
const videoTrack = props.annotateScreenStream ? props.localStreamScreen?.getVideoTracks()[0] : void 0;
|
|
43677
|
+
const { width = 0, height = 0 } = videoTrack?.getSettings() ?? {};
|
|
43678
|
+
return getContainedContentRect(
|
|
43679
|
+
props.customWidth,
|
|
43680
|
+
props.customHeight,
|
|
43681
|
+
width,
|
|
43682
|
+
height
|
|
43683
|
+
);
|
|
43684
|
+
});
|
|
43701
43685
|
const panelBorder = vue.computed(
|
|
43702
43686
|
() => props.isDarkMode ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.1)"
|
|
43703
43687
|
);
|
|
@@ -43744,7 +43728,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
43744
43728
|
overflowX: "hidden",
|
|
43745
43729
|
overflowY: "hidden",
|
|
43746
43730
|
boxSizing: "border-box",
|
|
43747
|
-
left:
|
|
43731
|
+
left: 0,
|
|
43748
43732
|
borderRadius: props.cellBorderRadius > 0 ? `${props.cellBorderRadius}px` : "0px"
|
|
43749
43733
|
}
|
|
43750
43734
|
}));
|
|
@@ -43763,10 +43747,10 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
43763
43747
|
class: "modern-flexible-video__screenboard",
|
|
43764
43748
|
style: {
|
|
43765
43749
|
position: "absolute",
|
|
43766
|
-
top:
|
|
43767
|
-
left: `${
|
|
43768
|
-
width: `${
|
|
43769
|
-
height: `${
|
|
43750
|
+
top: `${screenContentRect.value.top}px`,
|
|
43751
|
+
left: `${screenContentRect.value.left}px`,
|
|
43752
|
+
width: `${screenContentRect.value.width}px`,
|
|
43753
|
+
height: `${screenContentRect.value.height}px`,
|
|
43770
43754
|
backgroundColor: "rgba(0, 0, 0, 0.005)",
|
|
43771
43755
|
zIndex: 2,
|
|
43772
43756
|
pointerEvents: "none",
|
|
@@ -43794,17 +43778,17 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
43794
43778
|
};
|
|
43795
43779
|
const getCellStyle = (hasContent) => ({
|
|
43796
43780
|
flex: 1,
|
|
43797
|
-
width: `${
|
|
43798
|
-
height: `${
|
|
43799
|
-
minWidth: `${
|
|
43800
|
-
minHeight: `${
|
|
43801
|
-
maxWidth: `${
|
|
43802
|
-
maxHeight: `${
|
|
43781
|
+
width: `${props.customWidth}px`,
|
|
43782
|
+
height: `${props.customHeight}px`,
|
|
43783
|
+
minWidth: `${props.customWidth}px`,
|
|
43784
|
+
minHeight: `${props.customHeight}px`,
|
|
43785
|
+
maxWidth: `${props.customWidth}px`,
|
|
43786
|
+
maxHeight: `${props.customHeight}px`,
|
|
43803
43787
|
backgroundColor: getCellBgColor(hasContent),
|
|
43804
43788
|
margin: "1px",
|
|
43805
43789
|
padding: 0,
|
|
43806
43790
|
borderRadius: props.cellBorderRadius > 0 ? `${props.cellBorderRadius}px` : "0px",
|
|
43807
|
-
left:
|
|
43791
|
+
left: 0,
|
|
43808
43792
|
overflow: "hidden",
|
|
43809
43793
|
display: "flex",
|
|
43810
43794
|
alignItems: "center",
|
|
@@ -44703,6 +44687,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
44703
44687
|
renderContent: { type: Function, default: void 0 }
|
|
44704
44688
|
},
|
|
44705
44689
|
setup(__props) {
|
|
44690
|
+
const { SelfieSegmentation } = SelfieSegmentationModule;
|
|
44706
44691
|
const props = __props;
|
|
44707
44692
|
const RenderVNode = vue.defineComponent({
|
|
44708
44693
|
name: "RenderVNode",
|
|
@@ -44984,7 +44969,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
44984
44969
|
}
|
|
44985
44970
|
};
|
|
44986
44971
|
const preloadModel = async () => {
|
|
44987
|
-
const segmentation = new
|
|
44972
|
+
const segmentation = new SelfieSegmentation({
|
|
44988
44973
|
locateFile: (file) => `https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation/${file}`
|
|
44989
44974
|
});
|
|
44990
44975
|
segmentation.setOptions({
|
|
@@ -46224,7 +46209,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
46224
46209
|
};
|
|
46225
46210
|
}
|
|
46226
46211
|
});
|
|
46227
|
-
const ModernBackgroundModal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
46212
|
+
const ModernBackgroundModal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-23e6b2b6"]]);
|
|
46228
46213
|
const panelGradientBackground$1 = "linear-gradient(180deg, var(--ms-modern-panel-surface-elevated) 0%, var(--ms-modern-panel-surface) 100%)";
|
|
46229
46214
|
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
46230
46215
|
__name: "ModernConfirmHereModal",
|