Skip to content

Commit

Permalink
feat: Provide a document-based component capable of displaying video …
Browse files Browse the repository at this point in the history
…content. (close #1011)
  • Loading branch information
cnouguier committed Dec 9, 2024
1 parent d5382d7 commit 7ebd949
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions core/client/components/document/KVideo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<div v-if="url" class="fit">
<video
:src="url"
:controls="controls"
:autoplay="autoplay"
class="fit"
/>
</div>
</template>

<script setup>
import _ from 'lodash'
import { computed } from 'vue'
// Props
const props = defineProps({
url: {
type: String,
default: null
},
options: {
type: Object,
default: () => {
return {
controls: true,
autoplay: true
}
}
}
})
// Computed
const controls = computed(() => {
return _.get(props.options, 'controls', true)
})
const autoplay = computed(() => {
return _.get(props.options, 'autoplay', true)
})
</script>

0 comments on commit 7ebd949

Please sign in to comment.