extractify.zip/components/media/video-player.vue

25 lines
537 B
Vue
Raw Normal View History

<script lang="ts" setup>
2023-07-22 02:23:14 +03:00
import '@vime/core/themes/default.css';
import { Player, DefaultUi, Video } from '@vime/vue-next';
2023-07-21 20:23:33 +03:00
import mime from 'mime';
interface Props {
src: string
}
let { src } = defineProps<Props>();
2023-07-21 20:23:33 +03:00
let selectedPath = useSelectedPath();
let videoType = mime.getType(selectedPath.value);
2023-07-22 02:23:14 +03:00
</script>
<template>
2023-07-22 02:23:14 +03:00
<Player playsinline style="width: 100%">
<Video>
<source :data-src="src" :type="videoType!" />
</Video>
<DefaultUi>
</DefaultUi>
</Player>
</template>