提交 | 用户 | 时间
|
820397
|
1 |
<template> |
H |
2 |
<div class="w-full" :style="{ height: `${property.style.height}px` }"> |
|
3 |
<el-image class="w-full w-full" :src="property.posterUrl" v-if="property.posterUrl" /> |
|
4 |
<video |
|
5 |
v-else |
|
6 |
class="w-full w-full" |
|
7 |
:src="property.videoUrl" |
|
8 |
:poster="property.posterUrl" |
|
9 |
:autoplay="property.autoplay" |
|
10 |
controls |
|
11 |
></video> |
|
12 |
</div> |
|
13 |
</template> |
|
14 |
<script setup lang="ts"> |
|
15 |
import { VideoPlayerProperty } from './config' |
|
16 |
|
|
17 |
/** 视频播放 */ |
|
18 |
defineOptions({ name: 'VideoPlayer' }) |
|
19 |
|
|
20 |
defineProps<{ property: VideoPlayerProperty }>() |
|
21 |
</script> |
|
22 |
|
|
23 |
<style scoped lang="scss"> |
|
24 |
/* 图片 */ |
|
25 |
img { |
|
26 |
display: block; |
|
27 |
width: 100%; |
|
28 |
height: 100%; |
|
29 |
} |
|
30 |
</style> |