From 0c917ef199cf01b59fa2349ff27dc16ff8096b70 Mon Sep 17 00:00:00 2001 From: nokhnaton Date: Mon, 20 Jan 2025 01:20:23 +0900 Subject: [PATCH 001/154] =?UTF-8?q?SDK=E3=81=AE=E5=88=A9=E7=94=A8=E9=83=A8?= =?UTF-8?q?=E5=88=86=E3=81=A8=E4=BB=AE=E7=B5=84=E3=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 79 +++++++- package.json | 11 +- .../ChannelHeader/ChannelHeaderToolsList.vue | 5 +- .../Main/MainView/ChannelView/ChannelView.vue | 5 + .../Main/MainView/QallView/AudioTrack.vue | 23 +++ .../Main/MainView/QallView/QallView.vue | 24 +++ .../Main/MainView/QallView/VideoTrack.vue | 30 ++++ src/composables/qall/useLiveKitSDK.ts | 168 ++++++++++++++++++ src/composables/qall/useQall.ts | 28 +++ 9 files changed, 366 insertions(+), 7 deletions(-) create mode 100644 src/components/Main/MainView/QallView/AudioTrack.vue create mode 100644 src/components/Main/MainView/QallView/VideoTrack.vue create mode 100644 src/composables/qall/useLiveKitSDK.ts create mode 100644 src/composables/qall/useQall.ts diff --git a/package-lock.json b/package-lock.json index 2ff5b84880..0ef02b8e7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "firebase": "^11.1.0", "highlight.js": "^11.11.1", "idb-keyval": "^6.2.0", + "livekit-client": "^2.8.0", "mitt": "^3.0.0", "skyway-js": "^4.4.5", "text-field-edit": "^4.1.1", @@ -1651,6 +1652,11 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@bufbuild/protobuf": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.0.tgz", + "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==" + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -3096,6 +3102,19 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@livekit/mutex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@livekit/mutex/-/mutex-1.1.1.tgz", + "integrity": "sha512-EsshAucklmpuUAfkABPxJNhzj9v2sG7JuzFDL4ML1oJQSV14sqrpTYnsaOudMAw9yOaW53NU3QQTlUQoRs4czw==" + }, + "node_modules/@livekit/protocol": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/@livekit/protocol/-/protocol-1.30.0.tgz", + "integrity": "sha512-SDI9ShVKj8N3oOSinr8inaxD3FXgmgoJlqN35uU/Yx1sdoDeQbzAuBFox7bYjM+VhnZ1V22ivIDjAsKr00H+XQ==", + "dependencies": { + "@bufbuild/protobuf": "^1.10.0" + } + }, "node_modules/@mdi/js": { "version": "7.4.47", "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.4.47.tgz", @@ -8680,6 +8699,22 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/livekit-client": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/livekit-client/-/livekit-client-2.8.0.tgz", + "integrity": "sha512-8/IXhacAFYdXMU1wFyc8/MSGCzHr02Hn9T5o3MX19TR03RHSaBKBF2xK8fQFINBmpcYkiMAnQL0P6K3nfcifQA==", + "dependencies": { + "@livekit/mutex": "1.1.1", + "@livekit/protocol": "1.30.0", + "events": "^3.3.0", + "loglevel": "^1.8.0", + "sdp-transform": "^2.14.1", + "ts-debounce": "^4.0.0", + "tslib": "2.8.1", + "typed-emitter": "^2.1.0", + "webrtc-adapter": "^9.0.0" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -8795,6 +8830,18 @@ "node": ">=8" } }, + "node_modules/loglevel": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", + "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -10066,7 +10113,7 @@ "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, + "devOptional": true, "dependencies": { "tslib": "^2.1.0" } @@ -10163,6 +10210,11 @@ "node": ">=v12.22.7" } }, + "node_modules/sdp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/sdp/-/sdp-3.2.0.tgz", + "integrity": "sha512-d7wDPgDV3DDiqulJjKiV2865wKsJ34YI+NDREbm+FySq6WuKOikwyNQcm+doLAZ1O6ltdO0SeKle2xMpN3Brgw==" + }, "node_modules/sdp-transform": { "version": "2.14.2", "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.2.tgz", @@ -11116,6 +11168,11 @@ "typescript": ">=4.2.0" } }, + "node_modules/ts-debounce": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ts-debounce/-/ts-debounce-4.0.0.tgz", + "integrity": "sha512-+1iDGY6NmOGidq7i7xZGA4cm8DAa6fqdYcvO5Z6yBevH++Bdo9Qt/mN0TzHUgcCcKv1gmh9+W5dHqz8pMWbCbg==" + }, "node_modules/ts-pattern": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-5.6.0.tgz", @@ -11263,6 +11320,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typed-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typed-emitter/-/typed-emitter-2.1.0.tgz", + "integrity": "sha512-g/KzbYKbH5C2vPkaXGu8DJlHrGKHLsM25Zg9WuC9pMGfuvT+X25tZQWo5fK1BjBm8+UrVE9LDCvaY0CQk+fXDA==", + "optionalDependencies": { + "rxjs": "*" + } + }, "node_modules/typescript": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", @@ -12275,6 +12340,18 @@ "node": ">=12" } }, + "node_modules/webrtc-adapter": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/webrtc-adapter/-/webrtc-adapter-9.0.1.tgz", + "integrity": "sha512-1AQO+d4ElfVSXyzNVTOewgGT/tAomwwztX/6e3totvyyzXPvXIIuUUjAmyZGbKBKbZOXauuJooZm3g6IuFuiNQ==", + "dependencies": { + "sdp": "^3.2.0" + }, + "engines": { + "node": ">=6.0.0", + "npm": ">=3.10.0" + } + }, "node_modules/websocket-driver": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", diff --git a/package.json b/package.json index 4741096414..fea9c9601c 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "firebase": "^11.1.0", "highlight.js": "^11.11.1", "idb-keyval": "^6.2.0", + "livekit-client": "^2.8.0", "mitt": "^3.0.0", "skyway-js": "^4.4.5", "text-field-edit": "^4.1.1", @@ -51,8 +52,8 @@ "zod": "^3.24.1" }, "devDependencies": { - "@stylistic/eslint-plugin-ts": "^2.12.1", "@pinia/testing": "^0.1.6", + "@stylistic/eslint-plugin-ts": "^2.12.1", "@types/autosize": "^4.0.3", "@types/dom-screen-wake-lock": "^1.0.3", "@types/katex": "^0.16.7", @@ -63,9 +64,9 @@ "@types/throttle-debounce": "^5.0.2", "@types/turndown": "^5.0.5", "@types/vue-select": "^3.16.8", + "@types/webappsec-credential-management": "^0.6.9", "@typescript-eslint/eslint-plugin": "^8.19.0", "@typescript-eslint/parser": "^8.19.0", - "@types/webappsec-credential-management": "^0.6.9", "@typescript/lib-dom": "npm:@types/web@^0.0.72", "@vitejs/plugin-vue": "^5.2.1", "@vitest/coverage-v8": "^2.1.8", @@ -73,14 +74,14 @@ "autoprefixer": "^10.4.20", "axios": "^1.7.9", "browserslist": "^4.24.3", + "cypress": "^13.17.0", + "esbuild": "^0.24.2", + "esbuild-plugin-browserslist": "^0.15.0", "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-cypress": "^4.1.0", "eslint-plugin-unused-imports": "^4.1.4", "eslint-plugin-vue": "^9.32.0", - "cypress": "^13.17.0", - "esbuild": "^0.24.2", - "esbuild-plugin-browserslist": "^0.15.0", "fonteditor-core": "^2.4.1", "jsdom": "^25.0.1", "patch-package": "^8.0.0", diff --git a/src/components/Main/MainView/ChannelView/ChannelHeader/ChannelHeaderToolsList.vue b/src/components/Main/MainView/ChannelView/ChannelHeader/ChannelHeaderToolsList.vue index 09b79d83ea..7d9902809f 100644 --- a/src/components/Main/MainView/ChannelView/ChannelHeader/ChannelHeaderToolsList.vue +++ b/src/components/Main/MainView/ChannelView/ChannelHeader/ChannelHeaderToolsList.vue @@ -10,7 +10,7 @@ :data-is-active="$boolAttr(isQallSessionOpened)" :data-is-joined="$boolAttr(canEndQall)" :tooltip="qallLabel" - @click="toggleQall" + @click="toggleCalling(props.channelId)" /> { diff --git a/src/components/Main/MainView/ChannelView/ChannelView.vue b/src/components/Main/MainView/ChannelView/ChannelView.vue index b2023ce6ef..daf3515b0a 100644 --- a/src/components/Main/MainView/ChannelView/ChannelView.vue +++ b/src/components/Main/MainView/ChannelView/ChannelView.vue @@ -4,7 +4,9 @@ diff --git a/src/components/Main/MainView/QallView/QallView.vue b/src/components/Main/MainView/QallView/QallView.vue index ffa1a6b195..e29d2b8b56 100644 --- a/src/components/Main/MainView/QallView/QallView.vue +++ b/src/components/Main/MainView/QallView/QallView.vue @@ -2,8 +2,13 @@ import { useQall } from '/@/composables/qall/useQall' import VideoComponent from '/@/components/Main/MainView/QallView/VideoTrack.vue' import AudioComponent from '/@/components/Main/MainView/QallView/AudioTrack.vue' +import CallControlButton from './CallControlButton.vue' -const { tracksMap } = useQall() +const { tracksMap, toggleCalling } = useQall() + +const endCall = () => { + toggleCalling('') // Pass empty string since the channel name isn't needed for leaving +} From b7a26d81ad8778b05bcae37537848b57be7406aa Mon Sep 17 00:00:00 2001 From: masky5859 Date: Mon, 20 Jan 2025 23:58:59 +0900 Subject: [PATCH 012/154] =?UTF-8?q?Revert=20"feat:=E9=80=9A=E8=A9=B1?= =?UTF-8?q?=E5=91=A8=E3=82=8A=E3=81=AE=E3=83=9C=E3=82=BF=E3=83=B3=E7=94=A8?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC=E3=83=8D=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 67562d81a57e9016050e6352deb5afe694d716bd. --- src/assets/icons/call_off.svg | 9 ---- .../MainView/QallView/CallControlButton.vue | 42 ------------------- .../Main/MainView/QallView/QallView.vue | 11 +---- 3 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 src/assets/icons/call_off.svg delete mode 100644 src/components/Main/MainView/QallView/CallControlButton.vue diff --git a/src/assets/icons/call_off.svg b/src/assets/icons/call_off.svg deleted file mode 100644 index f70c5d3a3a..0000000000 --- a/src/assets/icons/call_off.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/components/Main/MainView/QallView/CallControlButton.vue b/src/components/Main/MainView/QallView/CallControlButton.vue deleted file mode 100644 index f86436ef3f..0000000000 --- a/src/components/Main/MainView/QallView/CallControlButton.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - - diff --git a/src/components/Main/MainView/QallView/QallView.vue b/src/components/Main/MainView/QallView/QallView.vue index e29d2b8b56..ffa1a6b195 100644 --- a/src/components/Main/MainView/QallView/QallView.vue +++ b/src/components/Main/MainView/QallView/QallView.vue @@ -2,13 +2,8 @@ import { useQall } from '/@/composables/qall/useQall' import VideoComponent from '/@/components/Main/MainView/QallView/VideoTrack.vue' import AudioComponent from '/@/components/Main/MainView/QallView/AudioTrack.vue' -import CallControlButton from './CallControlButton.vue' -const { tracksMap, toggleCalling } = useQall() - -const endCall = () => { - toggleCalling('') // Pass empty string since the channel name isn't needed for leaving -} +const { tracksMap } = useQall() From f4375b68fb844c45cbb53c3b1bf494b31f86794a Mon Sep 17 00:00:00 2001 From: masky5859 Date: Tue, 21 Jan 2025 00:06:15 +0900 Subject: [PATCH 013/154] =?UTF-8?q?feat:=E9=80=9A=E8=A9=B1=E5=91=A8?= =?UTF-8?q?=E3=82=8A=E3=81=AE=E3=83=9C=E3=82=BF=E3=83=B3=E7=94=A8=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=9D=E3=83=BC=E3=83=8D=E3=83=B3=E3=83=88=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icons/call_off.svg | 9 +++++ .../MainView/QallView/CallControlButton.vue | 38 +++++++++++++++++++ .../Main/MainView/QallView/QallView.vue | 10 ++++- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 src/assets/icons/call_off.svg create mode 100644 src/components/Main/MainView/QallView/CallControlButton.vue diff --git a/src/assets/icons/call_off.svg b/src/assets/icons/call_off.svg new file mode 100644 index 0000000000..f70c5d3a3a --- /dev/null +++ b/src/assets/icons/call_off.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/components/Main/MainView/QallView/CallControlButton.vue b/src/components/Main/MainView/QallView/CallControlButton.vue new file mode 100644 index 0000000000..e7e96b316e --- /dev/null +++ b/src/components/Main/MainView/QallView/CallControlButton.vue @@ -0,0 +1,38 @@ + + + \ No newline at end of file diff --git a/src/components/Main/MainView/QallView/QallView.vue b/src/components/Main/MainView/QallView/QallView.vue index ffa1a6b195..85e075656e 100644 --- a/src/components/Main/MainView/QallView/QallView.vue +++ b/src/components/Main/MainView/QallView/QallView.vue @@ -2,8 +2,12 @@ import { useQall } from '/@/composables/qall/useQall' import VideoComponent from '/@/components/Main/MainView/QallView/VideoTrack.vue' import AudioComponent from '/@/components/Main/MainView/QallView/AudioTrack.vue' +import CallControlButton from './CallControlButton.vue' +const { tracksMap, toggleCalling } = useQall() -const { tracksMap } = useQall() +const endCall = () => { + toggleCalling('') +} From 9d70ff1f283bcaf1ac172b75a6fa50402dbecf4b Mon Sep 17 00:00:00 2001 From: nokhnaton Date: Tue, 21 Jan 2025 00:21:01 +0900 Subject: [PATCH 014/154] =?UTF-8?q?=E3=81=BC=E3=81=8B=E3=81=97=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/qall/useLiveKitSDK.ts | 38 ++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/composables/qall/useLiveKitSDK.ts b/src/composables/qall/useLiveKitSDK.ts index e2a4a77934..9aefb26d6a 100644 --- a/src/composables/qall/useLiveKitSDK.ts +++ b/src/composables/qall/useLiveKitSDK.ts @@ -4,7 +4,8 @@ import { AudioPresets, createLocalScreenTracks, Room, - createLocalVideoTrack + createLocalVideoTrack, + LocalVideoTrack } from 'livekit-client' import type { RemoteTrack, @@ -18,6 +19,10 @@ import type { import { ref, watch, type Ref } from 'vue' import { useToastStore } from '/@/store/ui/toast' import apis from '/@/lib/apis' +import { VirtualBackgroundProcessor } from '@shiguredo/virtual-background' + +const virtualBackgroundAssetsPath = + 'https://cdn.jsdelivr.net/npm/@shiguredo/virtual-background@latest/dist' const { addErrorToast } = useToastStore() @@ -169,18 +174,37 @@ async function leaveRoom() { const Attributes = ref<{ [key: string]: string }>({}) -const addCameraTrack = async (videoInputDevice?: MediaDeviceInfo) => { +const addCameraTrack = async ( + videoInputDevice?: MediaDeviceInfo, + isBlur?: boolean +) => { try { if (!room.value) { addErrorToast('ルームが存在しません') return } - console.log({ - deviceId: videoInputDevice?.deviceId, - deviceName: videoInputDevice?.label + + const stream = await navigator.mediaDevices.getUserMedia({ + video: { deviceId: videoInputDevice?.deviceId } }) - const localTrack = await createLocalVideoTrack({ - deviceId: videoInputDevice?.deviceId + const track = stream.getVideoTracks()[0] + if (!track) { + addErrorToast('映像が取得できませんでした') + return + } + const processor = new VirtualBackgroundProcessor( + virtualBackgroundAssetsPath + ) + + const options = { + blurRadius: 15 // 背景ぼかし設定 + } + const processedTrack = await processor.startProcessing(track, options) + const localTrack = new LocalVideoTrack(processedTrack) + localTrack.on('ended', () => { + console.log('ended') + processor.stopProcessing() + track.stop() }) room.value?.localParticipant.publishTrack(localTrack) } catch { From 26218e7b55849ae48858f479dc09516f0594e6e2 Mon Sep 17 00:00:00 2001 From: masky5859 Date: Tue, 21 Jan 2025 00:31:55 +0900 Subject: [PATCH 015/154] =?UTF-8?q?fix:=E4=B8=80=E6=97=A6=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E3=81=9D=E3=81=86=E3=81=AA=E3=83=97=E3=83=AD=E3=83=91?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=82=92=E5=85=A8=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainView/QallView/CallControlButton.vue | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/Main/MainView/QallView/CallControlButton.vue b/src/components/Main/MainView/QallView/CallControlButton.vue index e7e96b316e..e99737dec8 100644 --- a/src/components/Main/MainView/QallView/CallControlButton.vue +++ b/src/components/Main/MainView/QallView/CallControlButton.vue @@ -1,5 +1,6 @@ + - \ No newline at end of file From 631feb7a4882f2ad6f256fc2140d52f15f6b1ba4 Mon Sep 17 00:00:00 2001 From: nokhnaton Date: Tue, 21 Jan 2025 00:44:17 +0900 Subject: [PATCH 016/154] =?UTF-8?q?=E3=82=AB=E3=83=A1=E3=83=A9=E3=81=AE?= =?UTF-8?q?=E9=96=8B=E6=94=BE=E5=87=A6=E7=90=86=E3=82=92=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/qall/useLiveKitSDK.ts | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/composables/qall/useLiveKitSDK.ts b/src/composables/qall/useLiveKitSDK.ts index 9aefb26d6a..7946939948 100644 --- a/src/composables/qall/useLiveKitSDK.ts +++ b/src/composables/qall/useLiveKitSDK.ts @@ -39,9 +39,15 @@ export type TrackInfo = ( participantIdentity: string } +type CameraProcessor = { + processor: VirtualBackgroundProcessor + track: MediaStreamVideoTrack +} + const room = ref() const speakerIdentity = ref([]) const tracksMap: Ref> = ref(new Map()) +const cameraProcesserMap: Ref> = ref(new Map()) function handleTrackSubscribed( track: RemoteTrack, @@ -201,11 +207,12 @@ const addCameraTrack = async ( } const processedTrack = await processor.startProcessing(track, options) const localTrack = new LocalVideoTrack(processedTrack) - localTrack.on('ended', () => { - console.log('ended') - processor.stopProcessing() - track.stop() - }) + if (localTrack.sid) { + cameraProcesserMap.value.set(localTrack.sid, { + processor, + track + }) + } room.value?.localParticipant.publishTrack(localTrack) } catch { addErrorToast('カメラの共有に失敗しました') @@ -251,6 +258,15 @@ const removeVideoTrack = async (localpublication: LocalTrackPublication) => { addErrorToast('ルームが存在しません') return } + const cameraProcessor = cameraProcesserMap.value.get( + localpublication.trackSid + ) + if (cameraProcessor) { + console.log('stopProcessing') + cameraProcessor.processor.stopProcessing() + cameraProcessor.track.stop() + cameraProcesserMap.value.delete(localpublication.trackSid) + } const { [localpublication.trackSid]: audioSid, ...newAttributes } = Attributes.value From 2d905435f9161b04de07ae2980eda53e7b62a02b Mon Sep 17 00:00:00 2001 From: nokhnaton Date: Tue, 21 Jan 2025 00:53:00 +0900 Subject: [PATCH 017/154] =?UTF-8?q?=E8=A7=A3=E6=94=BE=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/qall/useLiveKitSDK.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/composables/qall/useLiveKitSDK.ts b/src/composables/qall/useLiveKitSDK.ts index 7946939948..d150b4802d 100644 --- a/src/composables/qall/useLiveKitSDK.ts +++ b/src/composables/qall/useLiveKitSDK.ts @@ -47,7 +47,7 @@ type CameraProcessor = { const room = ref() const speakerIdentity = ref([]) const tracksMap: Ref> = ref(new Map()) -const cameraProcesserMap: Ref> = ref(new Map()) +const cameraProcessorMap: Ref> = ref(new Map()) function handleTrackSubscribed( track: RemoteTrack, @@ -207,13 +207,19 @@ const addCameraTrack = async ( } const processedTrack = await processor.startProcessing(track, options) const localTrack = new LocalVideoTrack(processedTrack) + await room.value?.localParticipant.publishTrack(localTrack).catch(e => { + addErrorToast('カメラの共有に失敗しました') + track.stop() + processor.stopProcessing() + return + }) if (localTrack.sid) { - cameraProcesserMap.value.set(localTrack.sid, { + console.log(localTrack.sid) + cameraProcessorMap.value.set(localTrack.sid, { processor, track }) } - room.value?.localParticipant.publishTrack(localTrack) } catch { addErrorToast('カメラの共有に失敗しました') return @@ -258,14 +264,14 @@ const removeVideoTrack = async (localpublication: LocalTrackPublication) => { addErrorToast('ルームが存在しません') return } - const cameraProcessor = cameraProcesserMap.value.get( + const cameraProcessor = cameraProcessorMap.value.get( localpublication.trackSid ) if (cameraProcessor) { console.log('stopProcessing') cameraProcessor.processor.stopProcessing() cameraProcessor.track.stop() - cameraProcesserMap.value.delete(localpublication.trackSid) + cameraProcessorMap.value.delete(localpublication.trackSid) } const { [localpublication.trackSid]: audioSid, ...newAttributes } = From d20fc5c4a33d52ed419238279482be9e2149459a Mon Sep 17 00:00:00 2001 From: nokhnaton Date: Tue, 21 Jan 2025 01:17:31 +0900 Subject: [PATCH 018/154] =?UTF-8?q?=E7=94=BB=E9=9D=A2=E5=85=B1=E6=9C=89?= =?UTF-8?q?=E3=81=AE=E9=9F=B3=E8=B3=AA=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/qall/useLiveKitSDK.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/composables/qall/useLiveKitSDK.ts b/src/composables/qall/useLiveKitSDK.ts index d150b4802d..f2173b8291 100644 --- a/src/composables/qall/useLiveKitSDK.ts +++ b/src/composables/qall/useLiveKitSDK.ts @@ -233,12 +233,26 @@ const addScreenShareTrack = async () => { return } const localTracks = await createLocalScreenTracks({ - audio: true + audio: { + channelCount: 2, + autoGainControl: false, + noiseSuppression: false, + echoCancellation: false, + voiceIsolation: false + } }) await Promise.all( localTracks.map(async t => { - await room.value?.localParticipant.publishTrack(t) + if (t.kind === Track.Kind.Video) { + await room.value?.localParticipant.publishTrack(t) + } else { + await room.value?.localParticipant.publishTrack(t, { + audioPreset: AudioPresets.musicHighQualityStereo, + dtx: false, + red: false + }) + } }) ) const videoSid = localTracks.find(t => t.kind === Track.Kind.Video)?.sid From 383f318496323beeeb12c5c3dc57895001368b6a Mon Sep 17 00:00:00 2001 From: nokhnaton Date: Tue, 21 Jan 2025 15:47:33 +0900 Subject: [PATCH 019/154] =?UTF-8?q?=E4=BB=AE=E6=83=B3=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E3=81=AE=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Main/MainView/QallView/QallView.vue | 13 ++++++++++++- src/composables/qall/useLiveKitSDK.ts | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/components/Main/MainView/QallView/QallView.vue b/src/components/Main/MainView/QallView/QallView.vue index 65f9924ed7..1416b0e580 100644 --- a/src/components/Main/MainView/QallView/QallView.vue +++ b/src/components/Main/MainView/QallView/QallView.vue @@ -12,6 +12,8 @@ onMounted(async () => { videoInputs.value = devices.filter(d => d.kind === 'videoinput') }) const selectedVideoInput = ref() + +const backgroundImage = ref()