DUNGEONS-34: implement Webka local streaming app
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
18
frontend/components/StreamVideo.vue
Normal file
18
frontend/components/StreamVideo.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{ stream: MediaStream | null; mirror?: boolean }>();
|
||||
const video = ref<HTMLVideoElement>();
|
||||
watch(
|
||||
() => props.stream,
|
||||
async (stream) => {
|
||||
await nextTick();
|
||||
if (video.value) {
|
||||
video.value.srcObject = stream;
|
||||
if (stream) void video.value.play().catch(() => {});
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<video ref="video" autoplay playsinline muted :class="{ mirrored: mirror }" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user