|
@@ -74,7 +74,7 @@
|
|
|
<audio ref="audio" loop autoplay playsinline :srcObject.prop="stream" v-if="stream" style="width: 300px;height:100px;"></audio>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="streamingStop(true)">{{ this.$t('broadcast.stop') }}</el-button>
|
|
|
+ <el-button type="primary" @click="streamingStop('rtc',true)">{{ this.$t('broadcast.stop') }}</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -98,7 +98,7 @@
|
|
|
</audio>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="streamingStop(true)">{{ this.$t('broadcast.stop') }}</el-button>
|
|
|
+ <el-button type="primary" @click="streamingStop('sip', true)">{{ this.$t('broadcast.stop') }}</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -230,6 +230,7 @@ import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
|
|
|
import ButtonCellRenderList from '@/components/AgGridCellRender/ButtonCellRenderList'
|
|
|
import * as API_Broadcast from '@/api/calling-broadcast'
|
|
|
import * as API_ServiceInfo from '@/api/ncs_service_info'
|
|
|
+import * as API_Part from '@/api/ncs_partInfo'
|
|
|
import { unix2Date } from '@/utils/Foundation'
|
|
|
import * as API_FrameGroup from '@/api/ncs_frameGroup'
|
|
|
import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
|
|
@@ -374,6 +375,9 @@ export default {
|
|
|
}, width: 150, cellRenderer: this.statusFormatter
|
|
|
},
|
|
|
{
|
|
|
+ headerName: this.$t('zy20241209.voiceType'), field: 'voice_type', sortable: true, filter: 'agTextColumnFilter', width: 150
|
|
|
+ },
|
|
|
+ {
|
|
|
headerName: this.$t('broadcast.broadcastMode'), field: 'broadcast_mode', sortable: true, filterFramework: 'RadioFilter', filterParams: {
|
|
|
listData: this.broadcastMode
|
|
|
}, width: 150,
|
|
@@ -456,9 +460,9 @@ export default {
|
|
|
buttonType: 'success',
|
|
|
onClick: () => {
|
|
|
if (this.stream === null) {
|
|
|
- this.streamingStart(param.data.id)
|
|
|
+ this.streamingStart(param.data)
|
|
|
} else {
|
|
|
- this.streamingStop(true)
|
|
|
+ this.streamingStop(param.data.voice_type, true)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -514,7 +518,7 @@ export default {
|
|
|
|
|
|
const _this = this
|
|
|
//每分钟检查一次websocket状态,如果掉线,则重连
|
|
|
- if (this.serverInfo.voice_type === "rtc") {
|
|
|
+ if (this.serverInfo.voice_type !== undefined && this.serverInfo.voice_type.toLowerCase() === 'rtc') {
|
|
|
setInterval(function () {
|
|
|
if (_this.janus === null) {
|
|
|
if (_this.rtcServer !== null && _this.rtcServer !== "") {
|
|
@@ -564,13 +568,20 @@ export default {
|
|
|
},
|
|
|
deleteSingle(row) {
|
|
|
this.handlerDelete(row.id)
|
|
|
- if (this.serverInfo.voice_type === "rtc") {
|
|
|
+ if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
|
|
|
this.deleteStreaming(row.id)
|
|
|
}
|
|
|
},
|
|
|
playBroadcast(row) {
|
|
|
console.log(row)
|
|
|
- if (this.serverInfo.voice_type === "rtc") {
|
|
|
+ if (row.voice_type !== null && row.voice_type !== "" && row.voice_type.toLowerCase() !== this.serverInfo.voice_type.toLowerCase()) {
|
|
|
+ this.$alert(this.$t('zy20241209.voiceTypeError'), this.$t('action.systemPrompt'),{
|
|
|
+ confirmButtonText: this.$t('action.yes'),
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
|
|
|
API_Broadcast.manulStart(row.id).then(res => {
|
|
|
const result = res.data
|
|
|
if (!result.success) {
|
|
@@ -602,7 +613,7 @@ export default {
|
|
|
},
|
|
|
stopBroadcast(row) {
|
|
|
console.log(row)
|
|
|
- if (this.serverInfo.voice_type === "rtc") {
|
|
|
+ if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
|
|
|
row.playing = false
|
|
|
this.gridApi.redrawRows()
|
|
|
this.manulPlay = false
|
|
@@ -775,7 +786,7 @@ export default {
|
|
|
delete this.formmodel.id
|
|
|
this.formmodel.part_id = this.$store.getters.partId
|
|
|
//判断 janus 是否连接状态
|
|
|
- if (this.serverInfo.voice_type === "rtc") {
|
|
|
+ if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
|
|
|
if (this.janus === null) {
|
|
|
if (this.rtcServer === null || this.rtcServer === "") {
|
|
|
this.getRtcServer()
|
|
@@ -790,7 +801,7 @@ export default {
|
|
|
API_Broadcast.add(this.formmodel).then(result => {
|
|
|
console.log(result)
|
|
|
if (result) {
|
|
|
- if (this.serverInfo.voice_type === "rtc") {
|
|
|
+ if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
|
|
|
if (result.id) {
|
|
|
this.createStreaming(result.id, result.audio_port);
|
|
|
} else {
|
|
@@ -892,7 +903,7 @@ export default {
|
|
|
|
|
|
if (result.finished){
|
|
|
this.auditionTotalMsg = null
|
|
|
- this.streamingStop(false)
|
|
|
+ this.streamingStop('rtc', false)
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: this.$t('broadcast.auditionEnd')
|
|
@@ -1085,13 +1096,17 @@ export default {
|
|
|
type: 'error',
|
|
|
message: this.$t('action.failedGetReturnMessage')
|
|
|
})
|
|
|
- return;
|
|
|
}
|
|
|
}})
|
|
|
},
|
|
|
- streamingStart(id) {
|
|
|
- if (this.serverInfo.voice_type === "rtc") {
|
|
|
- API_Broadcast.auditionStart(id).then(res => {
|
|
|
+ streamingStart(data) {
|
|
|
+ console.log(data)
|
|
|
+ let voiceType = data.voice_type
|
|
|
+ if (voiceType === null || voiceType === undefined || voiceType === "") {
|
|
|
+ voiceType = this.serverInfo.voice_type.toLowerCase()
|
|
|
+ }
|
|
|
+ if (voiceType.toLowerCase() === "rtc") {
|
|
|
+ API_Broadcast.auditionStart(data.id).then(res => {
|
|
|
const result = res.data
|
|
|
if (!result.success) {
|
|
|
this.$message({
|
|
@@ -1099,11 +1114,11 @@ export default {
|
|
|
message: result.message
|
|
|
})
|
|
|
} else {
|
|
|
- this.pluginHandle.send({message: {request: "watch", id: id}})
|
|
|
+ this.pluginHandle.send({message: {request: "watch", id: data.id}})
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- API_Broadcast.getBroadcastFileList(id).then(res => {
|
|
|
+ API_Broadcast.getBroadcastFileList(data.id).then(res => {
|
|
|
const filesUri = res.files_uri
|
|
|
for (let i = 0; i < filesUri.length; i++) {
|
|
|
this.audioList.push(DeviceUrl + filesUri[i])
|
|
@@ -1122,12 +1137,12 @@ export default {
|
|
|
if (this.audioIndex < this.audioList.length - 1) {
|
|
|
this.audioIndex++
|
|
|
} else {
|
|
|
- this.streamingStop("")
|
|
|
+ this.streamingStop('sip', '')
|
|
|
}
|
|
|
},
|
|
|
- streamingStop(personClose) {
|
|
|
- if (this.serverInfo.voice_type === "rtc") {
|
|
|
- this.pluginHandle.send({message: {request: "stop"}})
|
|
|
+ streamingStop(voiceType, personClose) {
|
|
|
+ if (voiceType.toLowerCase() === 'rtc') {
|
|
|
+ this.pluginHandle.send({message: {request: 'stop'}})
|
|
|
this.pluginHandle.hangup()
|
|
|
this.onCleanup()
|
|
|
if (personClose) {
|
|
@@ -1163,10 +1178,17 @@ export default {
|
|
|
API_ServiceInfo.getServiceInfo().then(response => {
|
|
|
this.serverInfo = response;
|
|
|
console.log("response", response)
|
|
|
+ })
|
|
|
|
|
|
- if (response.voice_type === "rtc") {
|
|
|
- if (this.rtcServer === null || this.rtcServer === "") {
|
|
|
- this.getRtcServer()
|
|
|
+ API_Part.getPartSetting(this.$store.getters.partId).then(res => {
|
|
|
+ if (res.voice_type !== null && res.voice_type !== "") {
|
|
|
+ this.serverInfo.voice_type = res.voice_type.toLowerCase()
|
|
|
+ console.log("this.serverInfo.voice_type ===> " + this.serverInfo.voice_type)
|
|
|
+ if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
|
|
|
+
|
|
|
+ if (this.rtcServer === null || this.rtcServer === "") {
|
|
|
+ this.getRtcServer()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -1178,8 +1200,8 @@ export default {
|
|
|
},
|
|
|
Time() {
|
|
|
setInterval(() => {
|
|
|
- if (this.audioList.length > 0) {
|
|
|
- this.audioTotalTime = this.$refs.audios.duration
|
|
|
+ if (this.audioList.length > 0 && this.$refs.audios && this.$refs.audios.duration !== undefined) {
|
|
|
+ this.audioTotalTime = this.$refs.audios.duration;
|
|
|
}
|
|
|
if (this.audioTotalTime !== 0 && !isNaN(this.audioTotalTime)) {
|
|
|
this.audioTime += 1
|