优化摄像头显示问题

This commit is contained in:
java110 2022-01-29 13:24:45 +08:00
parent dfda77dab3
commit 4fc2a7e97e
2 changed files with 11 additions and 6 deletions

View File

@ -7,7 +7,6 @@
<button type="button" class="btn-white btn btn-sm margin-right-sm" v-on:click="_changeCameras()">摄像头
</button>
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-light btn-sm" v-bind:class="{'btn-primary': cameraControlVideoInfo.cameraCount == 4}" v-on:click="_changeCount(4)">四路
</button>
<button type="button" class="btn btn-light btn-sm" v-bind:class="{'btn-primary': cameraControlVideoInfo.cameraCount == 6}" v-on:click="_changeCount(6)">六路
@ -19,13 +18,13 @@
<!-- 2*2-->
<div class="col-md-6" v-if="cameraControlVideoInfo.cameraCount == 4" v-for="(item,index) in cameraControlVideoInfo.machines">
<div class="form-group">
<video :id="item.machineId" controls autoplay="autoplay" muted width="100%" height="400px"></video>
<video :id="item.machineId" controls autoplay="autoplay" muted width="100%" height="400px" style="background-color: #000;"></video>
<span>摄像头:{{item.machineName}}</span>
</div>
</div>
<div class="col-md-4" v-if="cameraControlVideoInfo.cameraCount == 6" v-for="(item,index) in cameraControlVideoInfo.machines">
<div class="form-group">
<video :id="item.machineId" controls autoplay="autoplay" muted width="100%" height="400px"></video>
<video :id="item.machineId" controls autoplay="autoplay" muted width="100%" height="400px" style="background-color: #000;"></video>
<span>摄像头:{{item.machineName}}</span>
</div>
</div>

View File

@ -14,6 +14,10 @@
}
},
_initMethod: function() {
let _cameraCount = vc.getParam('cameraCount');
if (_cameraCount) {
$that.cameraControlVideoInfo.cameraCount = _cameraCount;
}
$that._listMachines(1, 500);
$that._initMachineVideo();
},
@ -102,8 +106,8 @@
communityId: vc.getCurrentCommunity().communityId,
}
vc.http.apiPost(
'/machine.playCameraCmd',
JSON.stringify(vc.component.deleteShopTypeInfo), {
'/machine.playCamera',
JSON.stringify(data), {
emulateJSON: true
},
function(json, res) {
@ -141,10 +145,11 @@
let data = {
callIds: _callIds,
communityId: vc.getCurrentCommunity().communityId,
machineId: _machines[0].machineId
}
vc.http.apiPost(
'/machine.heartbeatCamera',
JSON.stringify(vc.component.deleteShopTypeInfo), {
JSON.stringify(data), {
emulateJSON: true
},
function(json, res) {
@ -154,6 +159,7 @@
},
_changeCount: function(_count) {
$that.cameraControlVideoInfo.cameraCount = _count;
vc.jumpToPage('/video.html#/pages/property/videoControl?cameraCount=' + _count)
}
}
});