Преглед на файлове

fix record and recode list.

zuoxue преди 5 години
родител
ревизия
51311e10ff
променени са 1 файла, в които са добавени 28 реда и са изтрити 2 реда
  1. 28 2
      src/components/videoList.vue

+ 28 - 2
src/components/videoList.vue

@@ -31,6 +31,7 @@
 				<div style="margin-bottom: 0.5rem;">
 					<el-button type="primary" size="small" @click="startRecord()">录制</el-button>
 					<el-button type="primary" size="small" @click="stopRecord()">停止录制</el-button>
+					<el-button type="primary" size="small" @click="recordList()">录制列表</el-button>
 				</div>
 				<div style="display: flex; margin-bottom: 0.5rem; height: 2.5rem;">
 					<span style="width: 5rem; line-height: 2.5rem; text-align: right;">播放地址:</span>
@@ -133,7 +134,7 @@ export default {
 		startRecord:function(){
 			let that = this;
 			let streamInfo=this.currentPlayerInfo;
-			let startURL=this.$global.genApiUrl('/startRecord') + '&type=0&vhost='+streamInfo.vhost+"&app="+streamInfo.app+"&stream="+streamInfo.stream+"&wait_for_record=1&continue_record=1";
+			let startURL=this.$global.genApiUrl('/startRecord') + '&type=1&vhost='+streamInfo.vhost+"&app="+streamInfo.app+"&stream="+streamInfo.stream+"&wait_for_record=1&continue_record=1";
 			console.log(startURL);
 			this.$axios({
 				method: 'get',
@@ -158,7 +159,7 @@ export default {
 		stopRecord:function(){
 			let that = this;
 			let streamInfo=this.currentPlayerInfo;
-			let stopURL=this.$global.genApiUrl('/stopRecord') + '&type=0&vhost='+streamInfo.vhost+"&app="+streamInfo.app+"&stream="+streamInfo.stream;
+			let stopURL=this.$global.genApiUrl('/stopRecord') + '&type=1&vhost='+streamInfo.vhost+"&app="+streamInfo.app+"&stream="+streamInfo.stream;
 			console.log(stopURL);
 			this.$axios({
 				method: 'get',
@@ -179,6 +180,31 @@ export default {
 					});
 				}
 			});
+		},
+		recordList:function(){
+			let that = this;
+			let streamInfo=this.currentPlayerInfo;
+			let stopURL=this.$global.genApiUrl('/getMp4RecordFile') + '&vhost='+streamInfo.vhost+"&app="+streamInfo.app+"&stream="+streamInfo.stream+'&period=2020-05-08';
+			console.log(stopURL);
+			this.$axios({
+				method: 'get',
+				url: stopURL
+			}).then(function(res) {
+				console.log(JSON.stringify(res.data));
+				if (res.data.code == 0&&res.data) {
+					that.$message({
+						showClose: true,
+						message: '列表获取成功',
+						type: 'success'
+					});
+				}else{
+					that.$message({
+						showClose: true,
+						message: res.data.msg,
+						type: 'error'
+					});
+				}
+			});
 		}
 	}
 };