Commit dda68ac0441a9197fe5accc70e7a8e9e20715f88
1 parent
0199676a
优化录像下载,避免wvp代理使用双份流量
Showing
3 changed files
with
23 additions
and
13 deletions
web_src/src/components/CloudRecord.vue
| @@ -6,7 +6,9 @@ | @@ -6,7 +6,9 @@ | ||
| 6 | </el-header> | 6 | </el-header> |
| 7 | <el-main> | 7 | <el-main> |
| 8 | <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;"> | 8 | <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;"> |
| 9 | - <span style="font-size: 1rem; font-weight: bold;">云端录像</span> | 9 | + <span v-if="!recordDetail" >云端录像</span> |
| 10 | + <el-page-header v-if="recordDetail" @back="backToList" content="云端录像"> | ||
| 11 | + </el-page-header> | ||
| 10 | <div style="position: absolute; right: 5rem; top: 0.3rem;"> | 12 | <div style="position: absolute; right: 5rem; top: 0.3rem;"> |
| 11 | 节点选择: | 13 | 节点选择: |
| 12 | <el-select size="mini" @change="chooseMediaChange" style="width: 16rem; margin-right: 1rem;" v-model="mediaServerId" placeholder="请选择" :disabled="recordDetail"> | 14 | <el-select size="mini" @change="chooseMediaChange" style="width: 16rem; margin-right: 1rem;" v-model="mediaServerId" placeholder="请选择" :disabled="recordDetail"> |
| @@ -20,7 +22,6 @@ | @@ -20,7 +22,6 @@ | ||
| 20 | </div> | 22 | </div> |
| 21 | <div style="position: absolute; right: 1rem; top: 0.3rem;"> | 23 | <div style="position: absolute; right: 1rem; top: 0.3rem;"> |
| 22 | <el-button v-if="!recordDetail" icon="el-icon-refresh-right" circle size="mini" :loading="loading" @click="getRecordList()"></el-button> | 24 | <el-button v-if="!recordDetail" icon="el-icon-refresh-right" circle size="mini" :loading="loading" @click="getRecordList()"></el-button> |
| 23 | - <el-button v-if="recordDetail" icon="el-icon-arrow-left" circle size="mini" @click="backToList()"></el-button> | ||
| 24 | </div> | 25 | </div> |
| 25 | </div> | 26 | </div> |
| 26 | <div v-if="!recordDetail"> | 27 | <div v-if="!recordDetail"> |
| @@ -53,7 +54,7 @@ | @@ -53,7 +54,7 @@ | ||
| 53 | :total="total"> | 54 | :total="total"> |
| 54 | </el-pagination> | 55 | </el-pagination> |
| 55 | </div> | 56 | </div> |
| 56 | - <cloud-record-detail ref="cloudRecordDetail" v-if="recordDetail" :recordFile="chooseRecord" :mediaServerId="mediaServerId" ></cloud-record-detail> | 57 | + <cloud-record-detail ref="cloudRecordDetail" v-if="recordDetail" :recordFile="chooseRecord" :mediaServerId="mediaServerId" :mediaServerPath="mediaServerPath" ></cloud-record-detail> |
| 57 | </el-main> | 58 | </el-main> |
| 58 | </el-container> | 59 | </el-container> |
| 59 | </div> | 60 | </div> |
| @@ -72,6 +73,7 @@ | @@ -72,6 +73,7 @@ | ||
| 72 | return { | 73 | return { |
| 73 | mediaServerList: [], // 滅体节点列表 | 74 | mediaServerList: [], // 滅体节点列表 |
| 74 | mediaServerId: null, // 媒体服务 | 75 | mediaServerId: null, // 媒体服务 |
| 76 | + mediaServerPath: null, // 媒体服务地址 | ||
| 75 | recordList: [], // 设备列表 | 77 | recordList: [], // 设备列表 |
| 76 | chooseRecord: null, // 媒体服务 | 78 | chooseRecord: null, // 媒体服务 |
| 77 | 79 | ||
| @@ -115,6 +117,11 @@ | @@ -115,6 +117,11 @@ | ||
| 115 | that.mediaServerList = data.data; | 117 | that.mediaServerList = data.data; |
| 116 | if (that.mediaServerList.length > 0) { | 118 | if (that.mediaServerList.length > 0) { |
| 117 | that.mediaServerId = that.mediaServerList[0].id | 119 | that.mediaServerId = that.mediaServerList[0].id |
| 120 | + let port = that.mediaServerList[0].httpPort; | ||
| 121 | + if (location.protocol === "https:" && that.mediaServerList[0].httpSSlPort) { | ||
| 122 | + port = that.mediaServerList[0].httpSSlPort | ||
| 123 | + } | ||
| 124 | + that.mediaServerPath = location.protocol + "//" + that.mediaServerList[0].streamIp + ":" + port | ||
| 118 | that.getRecordList(); | 125 | that.getRecordList(); |
| 119 | } | 126 | } |
| 120 | }) | 127 | }) |
web_src/src/components/CloudRecordDetail.vue
| @@ -15,7 +15,8 @@ | @@ -15,7 +15,8 @@ | ||
| 15 | <i class="el-icon-video-camera" ></i> | 15 | <i class="el-icon-video-camera" ></i> |
| 16 | {{ item.substring(0,17)}} | 16 | {{ item.substring(0,17)}} |
| 17 | </el-tag> | 17 | </el-tag> |
| 18 | - <a class="el-icon-download" style="color: #409EFF;font-weight: 600;margin-left: 10px;" :href="`${basePath}/${mediaServerId}/record/${recordFile.app}/${recordFile.stream}/${chooseDate}/${item}`" download /> | 18 | +<!-- <a class="el-icon-download" style="color: #409EFF;font-weight: 600;margin-left: 10px;" :href="`${basePath}/${mediaServerId}/record/${recordFile.app}/${recordFile.stream}/${chooseDate}/${item}`" download />--> |
| 19 | + <a class="el-icon-download" style="color: #409EFF;font-weight: 600;margin-left: 10px;" :href="`${basePath}/download.html?url=${recordFile.app}/${recordFile.stream}/${chooseDate}/${item}`" target="_blank" /> | ||
| 19 | </li> | 20 | </li> |
| 20 | </ul> | 21 | </ul> |
| 21 | </div> | 22 | </div> |
| @@ -75,7 +76,7 @@ | @@ -75,7 +76,7 @@ | ||
| 75 | <li class="task-list-item" v-for="item in taskListEnded"> | 76 | <li class="task-list-item" v-for="item in taskListEnded"> |
| 76 | <div class="task-list-item-box" style="height: 2rem;line-height: 2rem;"> | 77 | <div class="task-list-item-box" style="height: 2rem;line-height: 2rem;"> |
| 77 | <span>{{ item.startTime.substr(10) }}-{{item.endTime.substr(10)}}</span> | 78 | <span>{{ item.startTime.substr(10) }}-{{item.endTime.substr(10)}}</span> |
| 78 | - <a class="el-icon-download download-btn" :href="basePath + '/' + item.recordFile" download > | 79 | + <a class="el-icon-download download-btn" :href="basePath + '/download.html?url=../' + item.recordFile" target="_blank"> |
| 79 | </a> | 80 | </a> |
| 80 | </div> | 81 | </div> |
| 81 | </li> | 82 | </li> |
| @@ -111,10 +112,10 @@ | @@ -111,10 +112,10 @@ | ||
| 111 | components: { | 112 | components: { |
| 112 | uiHeader, player | 113 | uiHeader, player |
| 113 | }, | 114 | }, |
| 114 | - props: ['recordFile', 'mediaServerId', 'dateFiles'], | 115 | + props: ['recordFile', 'mediaServerId', 'dateFiles', 'mediaServerPath'], |
| 115 | data() { | 116 | data() { |
| 116 | return { | 117 | return { |
| 117 | - basePath: process.env.NODE_ENV === 'development'?`${location.origin}/debug/zlm/${this.mediaServerId}`:`${location.origin}/zlm/${this.mediaServerId}`, | 118 | + basePath: `${this.mediaServerPath}/record`, |
| 118 | dateFilesObj: [], | 119 | dateFilesObj: [], |
| 119 | detailFiles: [], | 120 | detailFiles: [], |
| 120 | chooseDate: null, | 121 | chooseDate: null, |
| @@ -264,7 +265,7 @@ | @@ -264,7 +265,7 @@ | ||
| 264 | this.videoUrl = ""; | 265 | this.videoUrl = ""; |
| 265 | }else { | 266 | }else { |
| 266 | // TODO 控制列表滚动条 | 267 | // TODO 控制列表滚动条 |
| 267 | - this.videoUrl = `${this.basePath}/${this.mediaServerId}/record/${this.recordFile.app}/${this.recordFile.stream}/${this.chooseDate}/${this.choosedFile}` | 268 | + this.videoUrl = `${this.basePath}/${this.recordFile.app}/${this.recordFile.stream}/${this.chooseDate}/${this.choosedFile}` |
| 268 | console.log(this.videoUrl) | 269 | console.log(this.videoUrl) |
| 269 | } | 270 | } |
| 270 | 271 |
web_src/src/components/dialog/devicePlayer.vue
| @@ -287,11 +287,13 @@ export default { | @@ -287,11 +287,13 @@ export default { | ||
| 287 | // return `http://${baseZlmApi}/${streamInfo.app}/${streamInfo.streamId}.flv`; | 287 | // return `http://${baseZlmApi}/${streamInfo.app}/${streamInfo.streamId}.flv`; |
| 288 | if (location.protocol === "https:") { | 288 | if (location.protocol === "https:") { |
| 289 | if (streamInfo.wss_flv === null) { | 289 | if (streamInfo.wss_flv === null) { |
| 290 | - this.$message({ | ||
| 291 | - showClose: true, | ||
| 292 | - message: '媒体服务器未配置ssl端口', | ||
| 293 | - type: 'error' | ||
| 294 | - }); | 290 | + console.error("媒体服务器未配置ssl端口, 使用http端口") |
| 291 | + // this.$message({ | ||
| 292 | + // showClose: true, | ||
| 293 | + // message: '媒体服务器未配置ssl端口, ', | ||
| 294 | + // type: 'error' | ||
| 295 | + // }); | ||
| 296 | + return streamInfo.ws_flv | ||
| 295 | }else { | 297 | }else { |
| 296 | return streamInfo.wss_flv; | 298 | return streamInfo.wss_flv; |
| 297 | } | 299 | } |