videoDialog.vue 1.94 KB
Newer Older
qzhxx's avatar
qzhxx committed
1 2 3 4 5
<template>
  <!--新增弹框-->
  <el-dialog
    custom-class="party-dialog"
    title="视频详情"
xulili's avatar
xulili committed
6
    width="900px"
qzhxx's avatar
qzhxx committed
7 8 9 10 11 12 13 14 15 16
    :visible.sync="dialogVisible"
    :before-close="close"
  >
    <div>
      <!--
      <video :src="videoSrc" :poster="videoImg" :autoplay="playStatus" height="421" width="700" :muted="muteStatus">
        your browser does not support the video tag
      </video>
      <button @click="playClick" :class="{hide: isPlay}">点击播放</button> -->
      <!--class="video-js vjs-default-skin vjs-big-play-centered" -->
xulili's avatar
xulili committed
17 18 19 20 21 22 23 24 25 26
      <video
        :preload="preload"
        :poster="videoImg"
        :height="height"
        :width="width"
        align="center"
        :controls="controls"
        :autoplay="autoplay"
      >
        <source :src="videoSrc" type="video/mp4" />
qzhxx's avatar
qzhxx committed
27 28 29 30 31 32 33 34 35 36 37 38
      </video>
    </div>
    <!-- <div slot="footer" class="dialog-footer btn-group">
      <el-button size="mini" type="primary" @click="close">关闭</el-button>
    </div> -->
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
xulili's avatar
xulili committed
39 40 41 42 43 44 45
      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
46 47
      isMute: true,
      isPlay: false,
xulili's avatar
xulili committed
48 49 50
      width: "820", // 设置视频播放器的显示宽度(以像素为单位)
      height: "500", // 设置视频播放器的显示高度(以像素为单位)
      preload: "auto", //  建议浏览器是否应在<video>加载元素后立即开始下载视频数据。
qzhxx's avatar
qzhxx committed
51
      controls: true, // 确定播放器是否具有用户可以与之交互的控件。没有控件,启动视频播放的唯一方法是使用autoplay属性或通过Player API。
xulili's avatar
xulili committed
52 53
      autoplay: "",
    };
qzhxx's avatar
qzhxx committed
54 55 56 57 58 59
  },
  methods: {
    // 新增关闭
    close() {
      this.dialogVisible = false;
    },
xulili's avatar
xulili committed
60
  },
qzhxx's avatar
qzhxx committed
61 62 63 64 65
};
</script>

<style>
</style>