1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
<div @contextmenu.prevent>
<span v-for="(item,index) in videoList" :key="index">
<video
:preload="preload"
:poster="item.cover"
:height="height"
:width="width"
align="center"
:controls="controls"
>
<source :src="item.fileUrl" />
</video>
<span> </span>
</span>
</div>
</template>
<script>
export default {
name: "Video",
data() {
return {
videoList:[],
videoSrc:
"https://video.pearvideo.com/mp4/short/20200209/cont-1650197-14888002-hd.mp4",
videoImg: "https://sm.ms/image/ueRFCZfk2xTONGb",
playStatus: "",
muteStatus: "",
isMute: true,
isPlay: false,
width: "350", // 设置视频播放器的显示宽度(以像素为单位)
height: "200", // 设置视频播放器的显示高度(以像素为单位)
preload: "auto", // 建议浏览器是否应在<video>加载元素后立即开始下载视频数据。
controls: true, // 确定播放器是否具有用户可以与之交互的控件。没有控件,启动视频播放的唯一方法是使用autoplay属性或通过Player API。
autoplay: "",
};
},
// 自动播放属性,muted:静音播放
// autoplay: 'muted',
};
</script>
<style scoped >
</style>