videoDialog.vue 1.61 KB
Newer Older
qzhxx's avatar
qzhxx committed
1 2 3 4 5
<template>
  <!--新增弹框-->
  <el-dialog
    custom-class="party-dialog"
    title="视频详情"
qzhxx's avatar
qzhxx committed
6
    width="400px"
qzhxx's avatar
qzhxx committed
7 8
    :visible.sync="dialogVisible"
    :before-close="close"
qzhxx's avatar
qzhxx committed
9
    @contextmenu.prevent
qzhxx's avatar
qzhxx committed
10
  >
qzhxx's avatar
qzhxx committed
11 12 13 14 15 16 17
 <span v-for="(item,index) in videoList" :key="index">
    <video
      :preload="preload"
      :poster="item.cover"
      :height="height"
      :width="width"
      align="center"
qzhxx's avatar
qzhxx committed
18
      controls controlsList='nodownload noremote footbar'
qzhxx's avatar
qzhxx committed
19 20 21 22 23
    >
      <source :src="item.fileUrl"  />
    </video>
    <span>&nbsp;&nbsp;&nbsp;&nbsp; </span>
  </span>
qzhxx's avatar
qzhxx committed
24 25 26 27 28 29 30
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
qzhxx's avatar
qzhxx committed
31
      videoList:[],
xulili's avatar
xulili committed
32 33 34 35 36 37 38
      dialogVisible: false,
      // videoSrc: 'https://video.pearvideo.com/mp4/short/20200209/cont-1650197-14888002-hd.mp4',
      // videoImg: 'https://sm.ms/image/ueRFCZfk2xTONGb',
      videoSrc: "",
      videoImg: "",
      playStatus: "",
      muteStatus: "",
qzhxx's avatar
qzhxx committed
39 40
      isMute: true,
      isPlay: false,
qzhxx's avatar
qzhxx committed
41
     width: "320", // 设置视频播放器的显示宽度(以像素为单位)
qzhxx's avatar
qzhxx committed
42
      height: "200", // 设置视频播放器的显示高度(以像素为单位)
xulili's avatar
xulili committed
43
      preload: "auto", //  建议浏览器是否应在<video>加载元素后立即开始下载视频数据。
qzhxx's avatar
qzhxx committed
44
      controls: true, // 确定播放器是否具有用户可以与之交互的控件。没有控件,启动视频播放的唯一方法是使用autoplay属性或通过Player API。
xulili's avatar
xulili committed
45 46
      autoplay: "",
    };
qzhxx's avatar
qzhxx committed
47 48 49 50
  },
  methods: {
    // 新增关闭
    close() {
qzhxx's avatar
qzhxx committed
51 52
      // 为防止关闭后继续播放
      this.videoList = []
qzhxx's avatar
qzhxx committed
53 54
      this.dialogVisible = false;
    },
xulili's avatar
xulili committed
55
  },
qzhxx's avatar
qzhxx committed
56 57 58 59 60
};
</script>

<style>
</style>