添加通道音频设置
添加media配置
This commit is contained in:
@@ -31,10 +31,19 @@
|
||||
<el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" border style="width: 100%">
|
||||
<el-table-column prop="channelId" label="通道编号" width="210">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="通道名称" width="500">
|
||||
<el-table-column prop="name" label="通道名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="subCount" label="子节点数">
|
||||
</el-table-column>
|
||||
<el-table-column label="开启音频" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="updateChannel(scope.row)"
|
||||
v-model="scope.row.hasAudio"
|
||||
active-color="#409EFF">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
@@ -193,6 +202,7 @@
|
||||
},
|
||||
//通知设备上传媒体流
|
||||
sendDevicePush: function(itemData) {
|
||||
console.log(itemData)
|
||||
let deviceId = this.deviceId;
|
||||
this.isLoging = true;
|
||||
let channelId = itemData.channelId;
|
||||
@@ -204,7 +214,7 @@
|
||||
}).then(function(res) {
|
||||
let ssrc = res.data.ssrc;
|
||||
that.isLoging = false
|
||||
that.$refs.devicePlayer.play(res.data,deviceId,channelId);
|
||||
that.$refs.devicePlayer.play(res.data,deviceId,channelId,itemData.hasAudio);
|
||||
}).catch(function(e) {
|
||||
});
|
||||
},
|
||||
@@ -256,6 +266,16 @@
|
||||
this.currentPage = 1;
|
||||
this.total = 0;
|
||||
this.initData();
|
||||
},
|
||||
updateChannel: function(row) {
|
||||
console.log(row)
|
||||
this.$axios({
|
||||
method: 'post',
|
||||
url: `/api/channel/update/${this.deviceId}`,
|
||||
params: row
|
||||
}).then(function(res) {
|
||||
console.log(JSON.stringify(res));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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,22 @@
|
||||
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;
|
||||
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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user