Browse Source

修正音频编码判断代码错误,仅当存在AAC音轨时打开音频

pull/1/head
Lawrence 4 years ago
parent
commit
fcf64ffa5e
  1. 20
      web_src/src/components/gb28181/devicePlayer.vue

20
web_src/src/components/gb28181/devicePlayer.vue

@ -25,10 +25,8 @@
</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="second"> <el-tab-pane label="录像查询" name="second">
<el-date-picker v-model="videoHistory.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间" <el-date-picker v-model="videoHistory.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间" @change="recordList()"></el-date-picker>
@change="recordList()"></el-date-picker> <el-date-picker v-model="videoHistory.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间" @change="recordList()"></el-date-picker>
<el-date-picker v-model="videoHistory.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间"
@change="recordList()"></el-date-picker>
<el-table :data="videoHistory.searchHistoryResult" style="width: 100%"> <el-table :data="videoHistory.searchHistoryResult" style="width: 100%">
<el-table-column label="名称" prop="name" width="150"></el-table-column> <el-table-column label="名称" prop="name" width="150"></el-table-column>
<el-table-column label="文件" prop="filePath" width="300"></el-table-column> <el-table-column label="文件" prop="filePath" width="300"></el-table-column>
@ -66,10 +64,8 @@
<div class="control-round-inner"><i class="fa fa-pause-circle"></i></div> <div class="control-round-inner"><i class="fa fa-pause-circle"></i></div>
</div> </div>
<div style="position: absolute; left: 7.25rem; top: 1.25rem" @mousedown="ptzCamera(0, 0, 2)" @mouseup="ptzCamera(0, 0, 0)"><i <div style="position: absolute; left: 7.25rem; top: 1.25rem" @mousedown="ptzCamera(0, 0, 2)" @mouseup="ptzCamera(0, 0, 0)"><i class="el-icon-zoom-in" style="font-size: 1.875rem;"></i></div>
class="el-icon-zoom-in" style="font-size: 1.875rem;"></i></div> <div style="position: absolute; left: 7.25rem; top: 3.25rem; font-size: 1.875rem;" @mousedown="ptzCamera(0, 0, 1)" @mouseup="ptzCamera(0, 0, 0)"><i class="el-icon-zoom-out"></i></div>
<div style="position: absolute; left: 7.25rem; top: 3.25rem; font-size: 1.875rem;" @mousedown="ptzCamera(0, 0, 1)"
@mouseup="ptzCamera(0, 0, 0)"><i class="el-icon-zoom-out"></i></div>
</div> </div>
</div> </div>
@ -124,14 +120,14 @@
play: function (streamInfo, deviceId, channelId, hasAudio) { play: function (streamInfo, deviceId, channelId, hasAudio) {
this.hasaudio = hasAudio; this.hasaudio = hasAudio;
// //
if( this.hasaudio && !!streamInfo.tracks && streamInfo.tracks.length > 0) { if (!!streamInfo.tracks && streamInfo.tracks.length > 0) {
var realHasAudio = false; var realHasAudio = false;
for (let i = 0; i < streamInfo.tracks; i++) { for (let i = 0; i < streamInfo.tracks.length; i++) {
if (streamInfo.tracks[i].codec_type == 1) { // if (streamInfo.tracks[i].codec_type == 1 && streamInfo.tracks[i].codec_id_name == "CodecAAC") { // AAC
realHasAudio = true; realHasAudio = true;
} }
} }
this.hasaudio = realHasAudio && this.hasaudio; this.hasaudio = realHasAudio; //&& this.hasaudio;
} }
this.ssrc = streamInfo.ssrc; this.ssrc = streamInfo.ssrc;
this.deviceId = deviceId; this.deviceId = deviceId;

Loading…
Cancel
Save