去除lombok框架

添加流传输模式udp/tcp被动支持
This commit is contained in:
648540858
2020-10-16 16:49:41 +08:00
parent cc61ed4a07
commit 4d9a62339d
13 changed files with 739 additions and 70 deletions

View File

@@ -1,7 +1,8 @@
<template>
<div id="devicePlayer">
<el-dialog title="视频播放" top="0" :visible.sync="showVideoDialog" :destroy-on-close="true" @close="close()">
<LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :hasaudio="hasaudio" fluent autoplay live ></LivePlayer>
<LivePlayer v-if="showVideoDialog && hasaudio" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" hasaudio fluent autoplay live ></LivePlayer>
<LivePlayer v-if="showVideoDialog && !hasaudio" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" 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">
@@ -122,20 +123,20 @@
methods: {
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;
// this.hasaudio = hasAudio;
if (!hasAudio) { // hasaudio == false时设置播放器hasaudio false, 否则不设置
this.hasaudio = hasAudio;
}
console.log("111")
console.log(this.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;
// }
this.ssrc = streamInfo.ssrc;
this.deviceId = deviceId;
this.channelId = channelId;

View File

@@ -29,12 +29,12 @@
</el-table-column>
<el-table-column prop="model" label="固件版本" align="center">
</el-table-column>
<el-table-column label="通讯方式" align="center">
<el-table-column label="流传输模式" align="center" width="160">
<template slot-scope="scope">
<el-select @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="请选择">
<el-select size="mini" @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="请选择">
<el-option key="UDP" label="UDP" value="UDP"></el-option>
<el-option key="TCP-ACTIVE" label="TCP主动模式" value="TCP-ACTIVE"></el-option>
<el-option key="TCP-PASSIVE" label="TCP被动模式" :disabled="true" value="TCP-PASSIVE"></el-option>
<el-option key="TCP-ACTIVE" label="TCP主动模式" :disabled="true" value="TCP-ACTIVE"></el-option>
<el-option key="TCP-PASSIVE" label="TCP被动模式" value="TCP-PASSIVE"></el-option>
</el-select>
</template>
</el-table-column>
@@ -189,14 +189,14 @@
});
},
transportChange: function (row) {
console.log(`修改传输方式为 ${row.transport}${row.deviceId} `);
console.log(row);
console.log(`修改传输方式为 ${row.streamMode}${row.deviceId} `);
let that = this;
this.$axios({
method: 'get',
url: '/api/devices/' + row.deviceId + '/transport/' + row.transport
url: '/api/devices/' + row.deviceId + '/transport/' + row.streamMode
}).then(function(res) {
let ssrc = res.data.ssrc;
that.$refs.devicePlayer.play(ssrc,deviceId,channelId);
}).catch(function(e) {
});
}