Commit e8f27e3c authored by qzhxx's avatar qzhxx

阻止视频下载

parent 0cdbeec7
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
<el-input type="textarea" v-model="editForm.remarks"></el-input> <el-input type="textarea" v-model="editForm.remarks"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="展板视频" :label-width="formLabelWidth"> <el-form-item label="展板视频" :label-width="formLabelWidth">
<div class="video-box"> <div class="video-box" @contextmenu.prevent>
<div class="video-item" v-for="(item, index) in editForm.videoList" :key="index"> <div class="video-item" v-for="(item, index) in editForm.videoList" :key="index">
<video :src="item.fileUrl" controls controlsList='nodownload noremote footbar' /> <video :src="item.fileUrl" controls controlsList='nodownload noremote footbar' />
<span>{{ item.fileName }}</span> <span>{{ item.fileName }}</span>
......
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
<span>{{ item.remarks }}</span> <span>{{ item.remarks }}</span>
</el-form-item> </el-form-item>
<el-form-item label="展板视频" class="w100"> <el-form-item label="展板视频" class="w100">
<div class="video-box"> <div class="video-box" @contextmenu.prevent>
<div <div
class="video-item" class="video-item"
v-for="(vi, index) in item.videoList" v-for="(vi, index) in item.videoList"
:key="index" :key="index"
> >
<video :src="vi.fileUrl" controls /> <video :src="vi.fileUrl" controlsList='nodownload noremote footbar' />
<span>{{ vi.fileName }}</span> <span>{{ vi.fileName }}</span>
</div> </div>
</div> </div>
......
<template>
<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" -->
<video :preload="preload"
:poster="videoImg" :height="height" :width="width" align="center" :controls="controls" :autoplay="autoplay">
<source :src="videoSrc" >
</video>
</div>
</template>
<script>
export default {
name: 'Video',
data () {
return {
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: '820', // 设置视频播放器的显示宽度(以像素为单位)
height: '500', // 设置视频播放器的显示高度(以像素为单位)
preload: 'auto', // 建议浏览器是否应在<video>加载元素后立即开始下载视频数据。
controls: true, // 确定播放器是否具有用户可以与之交互的控件。没有控件,启动视频播放的唯一方法是使用autoplay属性或通过Player API。
autoplay: ''
}
}
// 自动播放属性,muted:静音播放
// autoplay: 'muted',
}
</script>
<style scoped >
</style>
...@@ -151,7 +151,8 @@ ...@@ -151,7 +151,8 @@
:visible.sync="FormVisible" :visible.sync="FormVisible"
:before-close="close" :before-close="close"
> >
<div class="dialog-content"> <!-- @contextmenu.prevent.capture -->
<div class="dialog-content" @contextmenu.prevent>
<span <span
v-for="(item, index) in videoList" v-for="(item, index) in videoList"
...@@ -173,7 +174,9 @@ ...@@ -173,7 +174,9 @@
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
components: {}, components: {},
data() { data() {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
width="400px" width="400px"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:before-close="close" :before-close="close"
@contextmenu.prevent
> >
<span v-for="(item,index) in videoList" :key="index"> <span v-for="(item,index) in videoList" :key="index">
<video <video
......
<template> <template>
<div> <div @contextmenu.prevent>
<span v-for="(item,index) in videoList" :key="index"> <span v-for="(item,index) in videoList" :key="index">
<video <video
:preload="preload" :preload="preload"
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
label-position="top" label-position="top"
> >
<el-form-item label="展板视频" class="w100"> <el-form-item label="展板视频" class="w100">
<div v-if="contentData.videoList.length"> <div v-if="contentData.videoList.length" @contextmenu.prevent>
<span <span
class="file-box" class="file-box"
v-for="(s, i) in contentData.videoList" v-for="(s, i) in contentData.videoList"
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
width="100%" width="100%"
height="100%" height="100%"
poster="images/applets/video.png" poster="images/applets/video.png"
controlsList='nodownload noremote footbar'
> >
<source :src="s.fileUrl" /> <source :src="s.fileUrl" />
</video> </video>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment