Commit 9d1a2b40 by Tianqing Liu

feat: 录像状态不展示云台控制

1 parent 5d3c6c84
<template> <template>
<div ref="container" :class="containerClassName" ></div> <div ref="container" :data-player-type="this.playerType" :class="containerClassName" ></div>
</template> </template>
<script> <script>
...@@ -44,6 +44,7 @@ export default { ...@@ -44,6 +44,7 @@ export default {
playOriginUrl: '', playOriginUrl: '',
rotateNum: 0, rotateNum: 0,
mirrorIndex: 0, mirrorIndex: 0,
playerType: 'live', // 播放器类型:live playback
player: { player: {
height: 0, height: 0,
...@@ -53,7 +54,11 @@ export default { ...@@ -53,7 +54,11 @@ export default {
}, },
computed: { computed: {
containerClassName() { containerClassName() {
return this.hideControls ? ['vion-player', 'hide-controls'] : 'vion-player'; // 样式不支持响应式,因为会覆盖掉播放器自身添加的样式
const list = ['vion-player'];
if (this.hideControls) list.push('hide-controls');
// if (this.playerType === 'playback') list.push('playback-status');
return list;
}, },
}, },
mounted() { mounted() {
...@@ -142,8 +147,10 @@ export default { ...@@ -142,8 +147,10 @@ export default {
setTimeout(() => { setTimeout(() => {
if (isPlayback) { if (isPlayback) {
this._jessibuca.playback(url, getPlaybackConfig()); this._jessibuca.playback(url, getPlaybackConfig());
this.playerType = 'playback';
} else { } else {
this._jessibuca.play(url); this._jessibuca.play(url);
this.playerType = 'live';
} }
this.playOriginUrl = url; this.playOriginUrl = url;
}, 150); }, 150);
...@@ -257,6 +264,12 @@ export default { ...@@ -257,6 +264,12 @@ export default {
::v-deep(.jessibuca-control-progress-simple) { ::v-deep(.jessibuca-control-progress-simple) {
display: none; display: none;
} }
// 云台控制
&[data-player-type="playback"] {
::v-deep(.jessibuca-ptz) {
display: none !important;
}
}
} }
.hide-controls { .hide-controls {
::v-deep(.jessibuca-controls) { ::v-deep(.jessibuca-controls) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!