|
@ -4,7 +4,7 @@ |
|
|
<div id="video-container" > |
|
|
<div id="video-container" > |
|
|
</div> |
|
|
</div> |
|
|
<div style="text-align:center;" > |
|
|
<div style="text-align:center;" > |
|
|
<el-button type="primary" size="small" @click="togglePlay">{{ play ? '正在播放' : '停止' }}</el-button> |
|
|
<el-button type="primary" size="small" @click="togglePlay">{{ play ? '播放' : '停止' }}</el-button> |
|
|
<!-- <el-tooltip effect="dark" :content="play ? '正在播放' : '停止'" > |
|
|
<!-- <el-tooltip effect="dark" :content="play ? '正在播放' : '停止'" > |
|
|
<i :class="play ? 'el-icon-video-pause' : 'el-icon-video-play'" @click="togglePlay" ></i> |
|
|
<i :class="play ? 'el-icon-video-pause' : 'el-icon-video-play'" @click="togglePlay" ></i> |
|
|
</el-tooltip>--> |
|
|
</el-tooltip>--> |
|
@ -34,7 +34,7 @@ |
|
|
token: '', |
|
|
token: '', |
|
|
player: null, |
|
|
player: null, |
|
|
enableZ:false, //默认关闭电子放大 |
|
|
enableZ:false, //默认关闭电子放大 |
|
|
play: false //默认停止播放 |
|
|
play: true //默认停止播放 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created(){ |
|
|
created(){ |
|
@ -48,7 +48,7 @@ |
|
|
url: 'ezopen://open.ys7.com/109860978/1.hd.live', |
|
|
url: 'ezopen://open.ys7.com/109860978/1.hd.live', |
|
|
audio: 1, // 是否默认开启声音 0 - 关闭 1 - 开启 |
|
|
audio: 1, // 是否默认开启声音 0 - 关闭 1 - 开启 |
|
|
autoplay: true, |
|
|
autoplay: true, |
|
|
templete: "security", |
|
|
templete: "simple", |
|
|
header: ["capturePicture"], |
|
|
header: ["capturePicture"], |
|
|
footer: ['talk','fullScreen'], |
|
|
footer: ['talk','fullScreen'], |
|
|
width: 608, |
|
|
width: 608, |
|
@ -80,28 +80,34 @@ |
|
|
},*/ |
|
|
},*/ |
|
|
// 播放/停止 监控 |
|
|
// 播放/停止 监控 |
|
|
togglePlay(){ |
|
|
togglePlay(){ |
|
|
if(!this.player) return; |
|
|
// if(!this.player || !this.play) return; |
|
|
switch (this.play) { |
|
|
switch (this.play) { |
|
|
case true: |
|
|
|
|
|
this.player.stop(); |
|
|
|
|
|
this.play = false; |
|
|
|
|
|
break; |
|
|
|
|
|
case false: |
|
|
case false: |
|
|
this.player.play(); |
|
|
this.player.play(); |
|
|
this.play = true; |
|
|
this.play = true; |
|
|
break; |
|
|
break; |
|
|
|
|
|
case true: |
|
|
|
|
|
this.player.stop(); |
|
|
|
|
|
this.play = false; |
|
|
|
|
|
break; |
|
|
default: |
|
|
default: |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 视频截图 |
|
|
// 视频截图 |
|
|
isCapturePicture(){ |
|
|
isCapturePicture(){ |
|
|
if(!this.player || !this.play) return; |
|
|
if(!this.player || !this.play) { |
|
|
|
|
|
this.$message({ showClose: true, type: 'error', message: '视频停止播放不能截图' }); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
this.player.capturePicture(); |
|
|
this.player.capturePicture(); |
|
|
}, |
|
|
}, |
|
|
// 全屏 |
|
|
// 全屏 |
|
|
isFullScreen(){ |
|
|
isFullScreen(){ |
|
|
if(!this.player || !this.play) return; |
|
|
if(!this.player || !this.play) { |
|
|
|
|
|
this.$message({ showClose: true, type: 'error', message: '视频停止播放不能全屏' }); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
this.player.fullScreen(); |
|
|
this.player.fullScreen(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|