diff --git a/public/components/property/addMonitorMachine/addMonitorMachine.html b/public/components/property/addMonitorMachine/addMonitorMachine.html
index e92e7bacd..c5a92032d 100644
--- a/public/components/property/addMonitorMachine/addMonitorMachine.html
+++ b/public/components/property/addMonitorMachine/addMonitorMachine.html
@@ -26,6 +26,12 @@
+
diff --git a/public/components/property/editMonitorMachine/editMonitorMachine.html b/public/components/property/editMonitorMachine/editMonitorMachine.html
index 53d2e4360..c8799957e 100644
--- a/public/components/property/editMonitorMachine/editMonitorMachine.html
+++ b/public/components/property/editMonitorMachine/editMonitorMachine.html
@@ -26,6 +26,12 @@
+
diff --git a/public/components/property/viewCameraVideo/viewCameraVideo.html b/public/components/property/viewCameraVideo/viewCameraVideo.html
new file mode 100644
index 000000000..d02a46904
--- /dev/null
+++ b/public/components/property/viewCameraVideo/viewCameraVideo.html
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+ {{viewCameraVideoInfo.machine.machineName}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/components/property/viewCameraVideo/viewCameraVideo.js b/public/components/property/viewCameraVideo/viewCameraVideo.js
new file mode 100644
index 000000000..aba96aefb
--- /dev/null
+++ b/public/components/property/viewCameraVideo/viewCameraVideo.js
@@ -0,0 +1,129 @@
+/**
+ 入驻小区
+ **/
+(function(vc) {
+ var DEFAULT_PAGE = 1;
+ var DEFAULT_ROWS = 1;
+ vc.extends({
+ data: {
+ viewCameraVideoInfo: {
+ machineId: '',
+ machine: {},
+ timer: {},
+ sdk: {}
+ }
+ },
+ _initMethod: function() {},
+ _initEvent: function() {
+ vc.on('viewCameraVideo', 'openCameraVideoModal', function(_machine) {
+ clearInterval($that.viewCameraVideoInfo.timer);
+ $that.viewCameraVideoInfo.machineId = _machine.machineId;
+ $('#viewCameraVideoModel').modal('show');
+ $that._listViewCameraVideoMachines();
+ $that._initMachineVideo();
+ });
+ },
+ methods: {
+ _listViewCameraVideoMachines: function() {
+ let param = {
+ params: {
+ page: 1,
+ row: 1,
+ machineId: $that.viewCameraVideoInfo.machineId,
+ communityId: vc.getCurrentCommunity().communityId
+ }
+ }
+ //发送get请求
+ vc.http.get('machineManage',
+ 'list',
+ param,
+ function(json, res) {
+ let _machineManageInfo = JSON.parse(json);
+ $that.viewCameraVideoInfo.machine = _machineManageInfo.machines[0];
+ $that.applyViewCamera($that.viewCameraVideoInfo.machine);
+ },
+ function(errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _initMachineVideo: function() {
+ timer = setInterval(function() {
+ $that.heartbeatCamera();
+ }, 1000 * 30)
+ },
+ _playVideo: function(_videoId, url) {
+ $('#viewCameraVideo').show();
+ //let sdk = null; // Global handler to do cleanup when replaying.
+ $that.viewCameraVideoInfo.sdk = new SrsRtcPlayerAsync();
+ $('#viewCameraVideo').prop('srcObject', $that.viewCameraVideoInfo.sdk.stream);
+ $that.viewCameraVideoInfo.sdk.play(url).then(function(session) {}).catch(function(reason) {
+ $that.viewCameraVideoInfo.sdk.close();
+ $('#viewCameraVideo').hide();
+ console.error(reason);
+ });
+ },
+ applyViewCamera: function(_machine) {
+ let data = {
+ machineId: _machine.machineId,
+ communityId: vc.getCurrentCommunity().communityId,
+ }
+ vc.http.apiPost(
+ '/machine.playCamera',
+ JSON.stringify(data), {
+ emulateJSON: true
+ },
+ function(json, res) {
+ //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+ let _json = JSON.parse(json);
+ if (_json.code == 0) {
+ $that._playVideo(_machine.machineId, _json.data.address);
+ _machine.callId = _json.data.callId
+ return;
+ }
+ vc.toast(_json.msg);
+ },
+ function(errInfo, error) {
+ console.log('请求失败处理');
+ vc.message(json);
+
+ });
+ },
+ heartbeatCamera: function() {
+ let _machine = $that.viewCameraVideoInfo.machine;
+ if (!_machine) {
+ return;
+ }
+
+ let _callIds = _machine.callId;
+
+ if (!_callIds) {
+ return;
+ }
+ let data = {
+ callIds: _callIds,
+ communityId: vc.getCurrentCommunity().communityId,
+ machineId: _machine.machineId
+ }
+ vc.http.apiPost(
+ '/machine.heartbeatCamera',
+ JSON.stringify(data), {
+ emulateJSON: true
+ },
+ function(json, res) {
+ //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+ let _json = JSON.parse(json);
+ if (_json.code == -3) { // 摄像头 未推流 重新播放推流
+ $that.viewCameras();
+ }
+ },
+ function(errInfo, error) {});
+ },
+ _closeViewCameraVideo: function() {
+ clearInterval($that.viewCameraVideoInfo.timer);
+ $that.viewCameraVideoInfo.sdk.close();
+ $('#viewCameraVideoModel').modal('hide');
+ }
+ }
+ });
+})(window.vc);
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
index 511e36934..3dd92e1cd 100644
--- a/public/index.html
+++ b/public/index.html
@@ -52,6 +52,8 @@
+
+
diff --git a/public/pages/property/monitorMachineManage/monitorMachineManage.html b/public/pages/property/monitorMachineManage/monitorMachineManage.html
index 2ac57c77a..bf6389ea7 100644
--- a/public/pages/property/monitorMachineManage/monitorMachineManage.html
+++ b/public/pages/property/monitorMachineManage/monitorMachineManage.html
@@ -59,6 +59,9 @@
|
+
+
+ |
|
@@ -80,6 +83,7 @@
{{machine.machineName}} |
{{machine.machineCode}} |
{{machine.machineVersion}} |
+ {{machine.machineIp}} |
{{machine.stateName}} |
{{machine.heartbeatTime}} |
@@ -91,6 +95,10 @@
+
+
+
|
@@ -112,4 +120,5 @@
+
\ No newline at end of file
diff --git a/public/pages/property/monitorMachineManage/monitorMachineManage.js b/public/pages/property/monitorMachineManage/monitorMachineManage.js
index 22f2fcb3d..b51c13321 100644
--- a/public/pages/property/monitorMachineManage/monitorMachineManage.js
+++ b/public/pages/property/monitorMachineManage/monitorMachineManage.js
@@ -133,6 +133,9 @@
});
_call();
}, 'MONITOR');
+ },
+ _openViewVideoModel: function(_machine) {
+ vc.emit('viewCameraVideo', 'openCameraVideoModal', _machine);
}
}
});
diff --git a/public/video.html b/public/video.html
index 0eeb5a0a9..36abbe328 100644
--- a/public/video.html
+++ b/public/video.html
@@ -58,12 +58,10 @@
+