From d21a00418e04cc773eaeeff3d220e5931023929a Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 15 三月 2022 16:58:50 +0800 Subject: [PATCH] 修复推流关联平台的bug --- web_src/src/components/dialog/devicePlayer.vue | 75 ++++++++++++++++++++++--------------- 1 files changed, 44 insertions(+), 31 deletions(-) diff --git a/web_src/src/components/dialog/devicePlayer.vue b/web_src/src/components/dialog/devicePlayer.vue index feba081..5a08006 100644 --- a/web_src/src/components/dialog/devicePlayer.vue +++ b/web_src/src/components/dialog/devicePlayer.vue @@ -39,30 +39,34 @@ </el-tab-pane> <!--{"code":0,"data":{"paths":["22-29-30.mp4"],"rootPath":"/home/kkkkk/Documents/ZLMediaKit/release/linux/Debug/www/record/hls/kkkkk/2020-05-11/"}}--> <el-tab-pane label="褰曞儚鏌ヨ" name="record" v-if="showRrecord"> - <div style="float: left"> - <span>褰曞儚鎺у埗</span> - <el-button-group style="margin-left: 1rem"> - <el-button size="mini" class="iconfont icon-zanting" title="寮�濮�" @click="gbPause()"></el-button> - <el-button size="mini" class="iconfont icon-kaishi" title="鏆傚仠" @click="gbPlay()"></el-button> - <el-dropdown size="mini" title="鎾斁鍊嶉��" @command="gbScale"> - <el-button size="mini"> - 鍊嶉�� <i class="el-icon-arrow-down el-icon--right"></i> - </el-button> - <el-dropdown-menu slot="dropdown"> - <el-dropdown-item command="0.25">0.25鍊嶉��</el-dropdown-item> - <el-dropdown-item command="0.5">0.5鍊嶉��</el-dropdown-item> - <el-dropdown-item command="1.0">1鍊嶉��</el-dropdown-item> - <el-dropdown-item command="2.0">2鍊嶉��</el-dropdown-item> - <el-dropdown-item command="4.0">4鍊嶉��</el-dropdown-item> - </el-dropdown-menu> - </el-dropdown> - </el-button-group> - </div> - <el-date-picker size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="鏃ユ湡" @change="queryRecords()"></el-date-picker> - <div class="block" > - <span class="demonstration" style="padding: 12px 36px 12px 0;float: left;">{{Math.floor(seekTime * sliderTime / 100000)}}绉�</span> - <el-slider style="width: 80%; float:left;" v-model="sliderTime" @change="gbSeek" :show-tooltip="false"></el-slider> - </div> + <div style="width: 100%;"> + <div style="width: 100%; text-align: left"> + <span>褰曞儚鎺у埗</span> + <el-button-group style="margin-left: 1rem;"> + <el-button size="mini" class="iconfont icon-zanting" title="寮�濮�" @click="gbPause()"></el-button> + <el-button size="mini" class="iconfont icon-kaishi" title="鏆傚仠" @click="gbPlay()"></el-button> + <el-dropdown size="mini" title="鎾斁鍊嶉��" style="margin-left: 1px;" @command="gbScale"> + <el-button size="mini"> + 鍊嶉�� <i class="el-icon-arrow-down el-icon--right"></i> + </el-button> + <el-dropdown-menu slot="dropdown"> + <el-dropdown-item command="0.25">0.25鍊嶉��</el-dropdown-item> + <el-dropdown-item command="0.5">0.5鍊嶉��</el-dropdown-item> + <el-dropdown-item command="1.0">1鍊嶉��</el-dropdown-item> + <el-dropdown-item command="2.0">2鍊嶉��</el-dropdown-item> + <el-dropdown-item command="4.0">4鍊嶉��</el-dropdown-item> + </el-dropdown-menu> + </el-dropdown> + </el-button-group> + <el-date-picker style="float: right;" size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="鏃ユ湡" @change="queryRecords()"></el-date-picker> + </div> + <div style="width: 100%; text-align: left"> + <span class="demonstration" style="padding: 12px 36px 12px 0;float: left;">{{showTimeText}}</span> + <el-slider style="width: 80%; float:left;" v-model="sliderTime" @change="gbSeek" :show-tooltip="false"></el-slider> + </div> + </div> + + <el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading"> <el-table-column label="鍚嶇О" prop="name"></el-table-column> <el-table-column label="鏂囦欢" prop="filePath"></el-table-column> @@ -235,6 +239,8 @@ tracksNotLoaded: false, sliderTime: 0, seekTime: 0, + recordStartTime: 0, + showTimeText: "00:00:00", }; }, methods: { @@ -301,7 +307,7 @@ this.isLoging = false; // this.videoUrl = streamInfo.rtc; this.videoUrl = this.getUrlByStreamInfo(streamInfo); - this.streamId = streamInfo.streamId; + this.streamId = streamInfo.stream; this.app = streamInfo.app; this.mediaServerId = streamInfo.mediaServerId; this.playFromStreamInfo(false, streamInfo) @@ -460,7 +466,10 @@ let that = this; let startTime = row.startTime + this.recordStartTime = row.startTime + this.showTimeText = row.startTime.split(" ")[1] let endtime = row.endTime + this.sliderTime = 0; this.seekTime = new Date(endtime).getTime() - new Date(startTime).getTime(); console.log(this.seekTime) if (that.streamId != "") { @@ -476,8 +485,9 @@ }).then(function (res) { var streamInfo = res.data; that.app = streamInfo.app; - that.streamId = streamInfo.streamId; + that.streamId = streamInfo.stream; that.mediaServerId = streamInfo.mediaServerId; + that.ssrc = streamInfo.ssrc; that.videoUrl = that.getUrlByStreamInfo(streamInfo); that.recordPlay = true; }); @@ -488,7 +498,7 @@ this.videoUrl = ''; this.$axios({ method: 'get', - url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId }).then(function (res) { if (callback) callback() }); @@ -508,7 +518,7 @@ }).then(function (res) { var streamInfo = res.data; that.app = streamInfo.app; - that.streamId = streamInfo.streamId; + that.streamId = streamInfo.stream; that.mediaServerId = streamInfo.mediaServerId; that.videoUrl = that.getUrlByStreamInfo(streamInfo); that.recordPlay = true; @@ -520,7 +530,7 @@ this.videoUrl = ''; this.$axios({ method: 'get', - url: '/api/download/stop/' + this.deviceId + "/" + this.channelId + url: '/api/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId }).then(function (res) { if (callback) callback() }); @@ -530,8 +540,6 @@ let that = this; this.$axios({ method: 'post', - // url: '/api/ptz/' + this.deviceId + '/' + this.channelId + '?leftRight=' + leftRight + '&upDown=' + upDown + - // '&inOut=' + zoom + '&moveSpeed=50&zoomSpeed=50' url: '/api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed }).then(function (res) {}); }, @@ -638,6 +646,11 @@ console.log('鍓嶇鎺у埗锛歴eek '); console.log(this.seekTime); console.log(this.sliderTime); + let showTime = new Date(new Date(this.recordStartTime).getTime() + this.seekTime * val / 100) + let hour = showTime.getHours(); + let minutes = showTime.getMinutes(); + let seconds = showTime.getSeconds(); + this.showTimeText = (hour < 10?("0" + hour):hour) + ":" + (minutes<10?("0" + minutes):minutes) + ":" + (seconds<10?("0" + seconds):seconds) this.$axios({ method: 'get', url: `/api/playback/seek/${this.streamId }/` + Math.floor(this.seekTime * val / 100000) -- Gitblit v1.8.0