Skip to content

Commit c28fa52

Browse files
authored
Merge pull request #100 from omgate234/feat/meeting-recorder
Feat/meeting recorder
2 parents e1c709b + e876eba commit c28fa52

File tree

10 files changed

+399
-60
lines changed

10 files changed

+399
-60
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [0.0.41]() - 2025-09-15
4+
## Improved
5+
- Bump Videodb Player to 0.0.6, which disposes the player on unmount
6+
7+
38
## [0.0.40]() - 2025-06-01
49
## Fixed
510
- Default screen will not display demo videos if images and audios are uploaded

package-lock.json

Lines changed: 6 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@videodb/chat-vue",
33
"description": "Chat component for Director",
4-
"version": "0.0.40",
4+
"version": "0.0.41",
55
"author": "VideoDB",
66
"license": "Apache-2.0",
77
"private": false,
@@ -68,15 +68,14 @@
6868
"vue-tsc": "^2.0.29"
6969
},
7070
"dependencies": {
71-
"@videodb/player-vue": "^0.0.5",
71+
"@videodb/player-vue": "~0.0.6",
7272
"dayjs": "^1.11.13",
7373
"katex": "^0.16.11",
7474
"marked": "^4.2.5",
7575
"marked-katex-extension": "^5.1.2",
7676
"prismjs": "^1.29.0",
7777
"socket.io-client": "^4.7.5",
7878
"swiper": "^11.1.10",
79-
"uuid": "^10.0.0",
8079
"vue3-popper": "^1.5.0"
8180
}
8281
}

src/components/chat/ChatInput.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
</template>
120120

121121
<script setup>
122-
import { v4 as uuidv4 } from "uuid";
123122
import { computed, nextTick, ref, watch } from "vue";
124123
import { useVideoDBChat } from "../../context";
125124
import ChatEnterIcon from "../icons/ChatEnter.vue";
@@ -285,7 +284,7 @@ const handlePaste = (event) => {
285284
const newImageAttachment = {
286285
type: "image",
287286
image_data: file,
288-
key: uuidv4(),
287+
key: crypto.randomUUID(),
289288
upload: true,
290289
upload_status: "in_queue",
291290
};
@@ -301,7 +300,7 @@ const handleFileUpload = (event) => {
301300
const newImageAttachment = {
302301
type: "image",
303302
image_data: file,
304-
key: uuidv4(),
303+
key: crypto.randomUUID(),
305304
upload: true,
306305
upload_status: "in_queue",
307306
};

src/components/chat/ChatInterface.vue

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="vdb-c-flex vdb-c-h-full vdb-c-w-full">
1010
<!-- Collapsible Sidebar -->
1111
<Sidebar
12-
v-if="sidebarConfig.enabled"
12+
v-if="showSidebar && sidebarConfig.enabled"
1313
ref="sidebarRef"
1414
:status="
1515
configStatus !== null && isSetupComplete ? 'active' : 'inactive'
@@ -44,6 +44,7 @@
4444
"
4545
@session-click="handleSessionClick"
4646
@collection-click="handleCollectionClick"
47+
@share-session="handleShareSession"
4748
/>
4849

4950
<!-- Main Content -->
@@ -68,6 +69,7 @@
6869
>
6970
<!-- Header -->
7071
<div
72+
v-if="showHeader"
7173
class="vdb-c-sticky vdb-c-top-0 vdb-c-z-40 vdb-c-flex vdb-c-w-full vdb-c-items-center vdb-c-justify-center vdb-c-bg-white vdb-c-px-12 md:vdb-c-px-[30px]"
7274
ref="headerRef"
7375
>
@@ -200,6 +202,7 @@
200202

201203
<!-- Chat Input -->
202204
<div
205+
v-if="showChatInput"
203206
class="vdb-c-chat-input-container vdb-c-transition-all vdb-c-duration-300 vdb-c-ease-in-out"
204207
:class="{
205208
'vdb-c-pointer-events-none vdb-c-opacity-20': !(
@@ -326,6 +329,14 @@
326329
@upload="handleUpload"
327330
@cancel-upload="showUploadDialog = false"
328331
/>
332+
333+
<!-- Share Modal -->
334+
<ShareModal
335+
:show-dialog="showShareModal"
336+
:session-id="sessionToShare?.session_id"
337+
:on-make-public="makeSessionPublic"
338+
@close="showShareModal = false"
339+
/>
329340
</section>
330341
</template>
331342

@@ -348,6 +359,7 @@ import UploadVideoQueryCard from "./elements/UploadVideoQueryCard.vue";
348359
import ConfirmModal from "../modals/ConfirmModal.vue";
349360
import CreateCollectionModal from "../modals/CreateCollectionModal.vue";
350361
import DeleteCollectionErrorModal from "../modals/DeleteCollectionErrorModal.vue";
362+
import ShareModal from "../modals/ShareModal.vue";
351363
import UploadModal from "../modals/UploadModal.vue";
352364
import Header from "./elements/Header.vue";
353365
@@ -447,6 +459,18 @@ const props = defineProps({
447459
],
448460
}),
449461
},
462+
showSidebar: {
463+
type: Boolean,
464+
default: true,
465+
},
466+
showHeader: {
467+
type: Boolean,
468+
default: true,
469+
},
470+
showChatInput: {
471+
type: Boolean,
472+
default: true,
473+
},
450474
});
451475
const emit = defineEmits([]);
452476
@@ -492,6 +516,7 @@ const {
492516
renameSession,
493517
saveMeetingContext,
494518
fetchMeetingContext,
519+
makeSessionPublic,
495520
} = useChatHook(props.chatHookConfig);
496521
497522
const {
@@ -566,6 +591,8 @@ const showDeleteImageDialog = ref(false);
566591
const imageToDelete = ref(null);
567592
const showDeleteCollectionErrorModal = ref(false);
568593
const deleteCollectionErrorCode = ref(null);
594+
const showShareModal = ref(false);
595+
const sessionToShare = ref(null);
569596
570597
const isSetupComplete = computed(() => {
571598
return (
@@ -786,6 +813,11 @@ const handleUpdateSessionName = async ({ sessionId: _sessionId, name }) => {
786813
}
787814
};
788815
816+
const handleShareSession = (session) => {
817+
sessionToShare.value = session;
818+
showShareModal.value = true;
819+
};
820+
789821
// --- Upload Dialog Handlers ---
790822
const showUploadDialog = ref(false);
791823
const handleUpload = async (uploadData) => {

src/components/chat/elements/Sidebar.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,15 @@
327327
>Rename</span
328328
>
329329
</button>
330+
<button
331+
@click.stop="shareSession(session)"
332+
class="vdb-c-mb-[2.5px] vdb-c-flex vdb-c-w-full vdb-c-items-center vdb-c-gap-8 vdb-c-rounded-lg vdb-c-px-12 vdb-c-py-8 hover:vdb-c-bg-roy"
333+
>
334+
<ShareIcon />
335+
<span class="vdb-c-text-sm vdb-c-text-black"
336+
>Share</span
337+
>
338+
</button>
330339
<div
331340
class="vdb-c-my-2 vdb-c-mb-[2.5px] vdb-c-h-px vdb-c-bg-[#EDEDED]"
332341
></div>
@@ -423,6 +432,7 @@ import CopyIcon from "../../icons/CopyIcon.vue";
423432
import CheckIcon from "../../icons/Check.vue";
424433
import DotVertical from "../../icons/DotVertical.vue";
425434
import EditIcon from "../../icons/Edit.vue";
435+
import ShareIcon from "../../icons/Share.vue";
426436
import Popper from "vue3-popper";
427437
428438
const props = defineProps({
@@ -515,6 +525,7 @@ const emit = defineEmits([
515525
"create-collection",
516526
"delete-collection",
517527
"update-session-name",
528+
"share-session",
518529
]);
519530
520531
const closeSidebar = () => {
@@ -630,6 +641,10 @@ const copySessionId = async (sessionId) => {
630641
console.error("Failed to copy session ID", error);
631642
}
632643
};
644+
645+
const shareSession = (session) => {
646+
emit("share-session", session);
647+
};
633648
</script>
634649
635650
<style>

src/components/hooks/useVideoDBAgent.js

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import io from "socket.io-client";
2-
import { v4 as uuidv4 } from "uuid";
32
import { computed, onBeforeMount, reactive, ref, toRefs, watch } from "vue";
43

54
const fetchData = async (rootUrl, endpoint) => {
@@ -189,6 +188,34 @@ export function useVideoDBAgent(config) {
189188
return res;
190189
};
191190

191+
const makeSessionPublic = async (sessionId, isPublic = true) => {
192+
const res = {};
193+
try {
194+
const response = await fetch(`${httpUrl}/session/${sessionId}/public`, {
195+
method: "PUT",
196+
headers: {
197+
Accept: "application/json",
198+
"Content-Type": "application/json",
199+
},
200+
body: JSON.stringify({ is_public: isPublic }),
201+
});
202+
203+
if (!response.ok) {
204+
throw new Error("Network response was not ok");
205+
}
206+
207+
const data = await response.json();
208+
res.status = "success";
209+
res.success = true;
210+
res.data = data;
211+
} catch (error) {
212+
res.status = "error";
213+
res.success = false;
214+
res.error = error.message;
215+
}
216+
return res;
217+
};
218+
192219
const refetchCollectionVideos = async () => {
193220
fetchCollectionVideos(session.collectionId).then((res) => {
194221
activeCollectionVideos.value = res.data;
@@ -322,7 +349,7 @@ export function useVideoDBAgent(config) {
322349
const loadSession = (sessionId) => {
323350
let fetchPastMessages = true;
324351
if (!sessionId) {
325-
sessionId = uuidv4();
352+
sessionId = crypto.randomUUID();
326353
fetchPastMessages = false;
327354
}
328355
if (debug) console.log("debug :videodb-chat session loading", sessionId);
@@ -692,5 +719,6 @@ export function useVideoDBAgent(config) {
692719
generateAudioUrl,
693720
saveMeetingContext,
694721
fetchMeetingContext,
722+
makeSessionPublic,
695723
};
696724
}

src/components/icons/Share.vue

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<template>
2+
<svg
3+
width="15"
4+
height="15"
5+
viewBox="0 0 15 15"
6+
fill="none"
7+
xmlns="http://www.w3.org/2000/svg"
8+
:class="className"
9+
>
10+
<path
11+
d="M7.81825 1.18188C7.64251 1.00615 7.35759 1.00615 7.18185 1.18188L4.18185 4.18188C4.00611 4.35762 4.00611 4.64254 4.18185 4.81828C4.35759 4.99401 4.64251 4.99401 4.81825 4.81828L7.05005 2.58648V9.49996C7.05005 9.74849 7.25152 9.94996 7.50005 9.94996C7.74858 9.94996 7.95005 9.74849 7.95005 9.49996V2.58648L10.1819 4.81828C10.3576 4.99401 10.6425 4.99401 10.8182 4.81828C10.994 4.64254 10.994 4.35762 10.8182 4.18188L7.81825 1.18188ZM2.5 9.99997C2.77614 9.99997 3 10.2238 3 10.5V12C3 12.5538 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2238 12.2239 9.99997 12.5 9.99997C12.7761 9.99997 13 10.2238 13 10.5V12C13 13.104 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2238 2.22386 9.99997 2.5 9.99997Z"
12+
:fill="fill"
13+
fill-rule="evenodd"
14+
clip-rule="evenodd"
15+
></path>
16+
</svg>
17+
</template>
18+
19+
<script>
20+
import { defineProps } from "vue";
21+
export default {
22+
name: "Share",
23+
};
24+
25+
defineProps({
26+
className: {
27+
type: String,
28+
default: "",
29+
},
30+
fill: {
31+
type: String,
32+
default: "#FFF5EC",
33+
},
34+
});
35+
</script>
36+
37+
<style scoped>
38+
svg path {
39+
color: currentColor;
40+
fill: currentColor;
41+
}
42+
</style>

0 commit comments

Comments
 (0)