From fbdad00cdb294a857f55e33b2dd92c61dc37475c Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 13 十月 2020 18:55:42 +0800
Subject: [PATCH] 修复无音频通道开启通道音频后无法播放的bug 修复点播接口真的收到视频后回复
---
web_src/src/components/gb28181/devicePlayer.vue | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/web_src/src/components/gb28181/devicePlayer.vue b/web_src/src/components/gb28181/devicePlayer.vue
index dc69adb..9e497e4 100644
--- a/web_src/src/components/gb28181/devicePlayer.vue
+++ b/web_src/src/components/gb28181/devicePlayer.vue
@@ -1,7 +1,7 @@
<template>
<div id="devicePlayer">
<el-dialog title="瑙嗛鎾斁" top="0" :visible.sync="showVideoDialog" :destroy-on-close="true" @close="stop()">
- <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" fluent autoplay live stretch></LivePlayer>
+ <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :hasaudio="hasaudio" fluent autoplay live ></LivePlayer>
<div id="shared" style="text-align: right; margin-top: 1rem;">
<el-tabs v-model="tabActiveName">
<el-tab-pane label="濯掍綋娴佷俊鎭�" name="media">
@@ -114,17 +114,34 @@
ssrc: '',
deviceId: '',
channelId: '',
- tabActiveName: 'media'
+ tabActiveName: 'media',
+ hasaudio: false
};
},
methods: {
- play: function(streamInfo, deviceId, channelId) {
+ play: function(streamInfo, deviceId, channelId, hasAudio) {
+ console.log(hasAudio);
+ this.hasaudio = hasAudio;
+ // 鏍规嵁濯掍綋娴佷俊鎭簩娆″垽鏂�
+ if( this.hasaudio && !!streamInfo.tracks && streamInfo.tracks.length > 0) {
+ var realHasAudio = false;
+ for (let i = 0; i < streamInfo.tracks; i++) {
+ if (streamInfo.tracks[i].codec_type == 1) { // 鍒ゆ柇涓洪煶棰�
+ realHasAudio = true;
+ }
+ }
+ this.hasaudio = realHasAudio && this.hasaudio;
+ }
+ console.log("111")
+ console.log(this.hasaudio)
this.ssrc = streamInfo.ssrc;
this.deviceId = deviceId;
this.channelId = channelId;
- this.videoUrl = streamInfo.flv + "?" + new Date().getTime();
+ // this.$refs.videoPlayer.hasaudio = hasAudio;
+ // this.videoUrl = streamInfo.flv + "?" + new Date().getTime();
+ this.videoUrl = streamInfo.ws_flv;
this.showVideoDialog = true;
console.log(this.ssrc);
},
--
Gitblit v1.8.0