Browse Source

优化回放控制界面

pull/249/head
648540858 3 years ago
parent
commit
33a5911f94
  1. 26
      web_src/src/components/dialog/devicePlayer.vue

26
web_src/src/components/dialog/devicePlayer.vue

@ -39,12 +39,13 @@
</el-tab-pane> </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/"}}--> <!--{"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"> <el-tab-pane label="录像查询" name="record" v-if="showRrecord">
<div style="float: left"> <div style="width: 100%;">
<div style="width: 100%; text-align: left">
<span>录像控制</span> <span>录像控制</span>
<el-button-group style="margin-left: 1rem"> <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-zanting" title="开始" @click="gbPause()"></el-button>
<el-button size="mini" class="iconfont icon-kaishi" title="暂停" @click="gbPlay()"></el-button> <el-button size="mini" class="iconfont icon-kaishi" title="暂停" @click="gbPlay()"></el-button>
<el-dropdown size="mini" title="播放倍速" @command="gbScale"> <el-dropdown size="mini" title="播放倍速" style="margin-left: 1px;" @command="gbScale">
<el-button size="mini"> <el-button size="mini">
倍速 <i class="el-icon-arrow-down el-icon--right"></i> 倍速 <i class="el-icon-arrow-down el-icon--right"></i>
</el-button> </el-button>
@ -57,12 +58,15 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</el-button-group> </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>
<el-date-picker size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="queryRecords()"></el-date-picker> <div style="width: 100%; text-align: left">
<div class="block" > <span class="demonstration" style="padding: 12px 36px 12px 0;float: left;">{{showTimeText}}</span>
<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> <el-slider style="width: 80%; float:left;" v-model="sliderTime" @change="gbSeek" :show-tooltip="false"></el-slider>
</div> </div>
</div>
<el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading"> <el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading">
<el-table-column label="名称" prop="name"></el-table-column> <el-table-column label="名称" prop="name"></el-table-column>
<el-table-column label="文件" prop="filePath"></el-table-column> <el-table-column label="文件" prop="filePath"></el-table-column>
@ -235,6 +239,8 @@ export default {
tracksNotLoaded: false, tracksNotLoaded: false,
sliderTime: 0, sliderTime: 0,
seekTime: 0, seekTime: 0,
recordStartTime: 0,
showTimeText: "00:00:00",
}; };
}, },
methods: { methods: {
@ -460,7 +466,10 @@ export default {
let that = this; let that = this;
let startTime = row.startTime let startTime = row.startTime
this.recordStartTime = row.startTime
this.showTimeText = row.startTime.split(" ")[1]
let endtime = row.endTime let endtime = row.endTime
this.sliderTime = 0;
this.seekTime = new Date(endtime).getTime() - new Date(startTime).getTime(); this.seekTime = new Date(endtime).getTime() - new Date(startTime).getTime();
console.log(this.seekTime) console.log(this.seekTime)
if (that.streamId != "") { if (that.streamId != "") {
@ -638,6 +647,11 @@ export default {
console.log('前端控制:seek '); console.log('前端控制:seek ');
console.log(this.seekTime); console.log(this.seekTime);
console.log(this.sliderTime); 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({ this.$axios({
method: 'get', method: 'get',
url: `/api/playback/seek/${this.streamId }/` + Math.floor(this.seekTime * val / 100000) url: `/api/playback/seek/${this.streamId }/` + Math.floor(this.seekTime * val / 100000)

Loading…
Cancel
Save