|
@@ -37,7 +37,7 @@
|
|
/>
|
|
/>
|
|
</ag-grid-layout>
|
|
</ag-grid-layout>
|
|
|
|
|
|
- <el-dialog title="手动播放" width="300" :visible="manulPlay" :show-close="false">
|
|
|
|
|
|
+ <el-dialog :title="this.$t('broadcast.playManually')" width="300" :visible="manulPlay" :show-close="false">
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
{{auditionTotalMsg}}
|
|
{{auditionTotalMsg}}
|
|
@@ -52,11 +52,11 @@
|
|
<el-progress :show-text="false" :text-inside="true" :stroke-width="30" :percentage="auditionPositionPercent" status="success"></el-progress>
|
|
<el-progress :show-text="false" :text-inside="true" :stroke-width="30" :percentage="auditionPositionPercent" status="success"></el-progress>
|
|
</el-row>
|
|
</el-row>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button type="primary" @click="stopBroadcast(currentRow)">停止</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="stopBroadcast(currentRow)">{{ this.$t('broadcast.stop') }}</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="试听" width="300" :visible="stream!==null" :show-close="false">
|
|
|
|
|
|
+ <el-dialog :title="this.$t('broadcast.audition')" width="300" :visible="stream!==null" :show-close="false">
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
{{auditionTotalMsg}}
|
|
{{auditionTotalMsg}}
|
|
@@ -74,7 +74,7 @@
|
|
<audio ref="audio" loop autoplay playsinline :srcObject.prop="stream" v-if="stream" style="width: 300px;height:100px;"></audio>
|
|
<audio ref="audio" loop autoplay playsinline :srcObject.prop="stream" v-if="stream" style="width: 300px;height:100px;"></audio>
|
|
</div>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button type="primary" @click="streamingStop(true)">停止</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="streamingStop(true)">{{ this.$t('broadcast.stop') }}</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
@@ -205,6 +205,7 @@
|
|
import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
|
|
import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
|
|
import ButtonCellRenderList from '@/components/AgGridCellRender/ButtonCellRenderList'
|
|
import ButtonCellRenderList from '@/components/AgGridCellRender/ButtonCellRenderList'
|
|
import * as API_Broadcast from '@/api/calling-broadcast'
|
|
import * as API_Broadcast from '@/api/calling-broadcast'
|
|
|
|
+import * as API_ServiceInfo from '@/api/ncs_service_info'
|
|
import { unix2Date } from '@/utils/Foundation'
|
|
import { unix2Date } from '@/utils/Foundation'
|
|
import * as API_FrameGroup from '@/api/ncs_frameGroup'
|
|
import * as API_FrameGroup from '@/api/ncs_frameGroup'
|
|
import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
|
|
import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
|
|
@@ -229,7 +230,8 @@ export default {
|
|
components: { ButtonCellRenderList, ListFilter, RadioFilter },
|
|
components: { ButtonCellRenderList, ListFilter, RadioFilter },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- rtcServer: "ws://192.168.1.54:20022/janus",
|
|
|
|
|
|
+ // rtcServer: "ws://192.168.1.54:20022/janus",
|
|
|
|
+ rtcServer: "",
|
|
opaqueId: "streaming-"+randomString(12),
|
|
opaqueId: "streaming-"+randomString(12),
|
|
janus: null, //实例
|
|
janus: null, //实例
|
|
pluginHandle: null, //插件
|
|
pluginHandle: null, //插件
|
|
@@ -409,7 +411,7 @@ export default {
|
|
buttonSize: 'mini',
|
|
buttonSize: 'mini',
|
|
disabled: param.data.broadcast_mode !== 1 || !param.data.status
|
|
disabled: param.data.broadcast_mode !== 1 || !param.data.status
|
|
},{
|
|
},{
|
|
- label: '试听',
|
|
|
|
|
|
+ label: this.$t('broadcast.audition'),
|
|
buttonSize: 'mini',
|
|
buttonSize: 'mini',
|
|
buttonType: 'success',
|
|
buttonType: 'success',
|
|
onClick: () => {
|
|
onClick: () => {
|
|
@@ -425,7 +427,7 @@ export default {
|
|
filter: false,
|
|
filter: false,
|
|
pinned: 'right',
|
|
pinned: 'right',
|
|
lockPinned: true,
|
|
lockPinned: true,
|
|
- width: 290,
|
|
|
|
|
|
+ width: this.$i18n.locale === 'zh' ? 290 : 300,
|
|
resizable: false,
|
|
resizable: false,
|
|
sortable: false
|
|
sortable: false
|
|
}
|
|
}
|
|
@@ -457,21 +459,30 @@ export default {
|
|
]
|
|
]
|
|
})
|
|
})
|
|
this.getAllFrameGroups()
|
|
this.getAllFrameGroups()
|
|
|
|
+ if (this.rtcServer === null || this.rtcServer === "") {
|
|
|
|
+ this.getRtcServer()
|
|
|
|
+ }
|
|
|
|
|
|
this.initAuditionWebSocket()
|
|
this.initAuditionWebSocket()
|
|
- Janus.init({
|
|
|
|
- debug: false,
|
|
|
|
- dependencies: Janus.useDefaultDependencies(),
|
|
|
|
- callback: () => {
|
|
|
|
- this.connect(this.rtcServer)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ // Janus.init({
|
|
|
|
+ // debug: false,
|
|
|
|
+ // dependencies: Janus.useDefaultDependencies(),
|
|
|
|
+ // callback: () => {
|
|
|
|
+ // if (this.rtcServer !== null && this.rtcServer !== "") {
|
|
|
|
+ // this.connect(this.rtcServer)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
|
|
const _this = this
|
|
const _this = this
|
|
//每分钟检查一次websocket状态,如果掉线,则重连
|
|
//每分钟检查一次websocket状态,如果掉线,则重连
|
|
setInterval(function() {
|
|
setInterval(function() {
|
|
if (_this.janus === null) {
|
|
if (_this.janus === null) {
|
|
- _this.connect(this.rtcServer)
|
|
|
|
|
|
+ if (_this.rtcServer !== null && _this.rtcServer !== "") {
|
|
|
|
+ _this.connect(this.rtcServer)
|
|
|
|
+ } else {
|
|
|
|
+ this.getRtcServer()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (_this.websock === null) {
|
|
if (_this.websock === null) {
|
|
_this.initAuditionWebSocket()
|
|
_this.initAuditionWebSocket()
|
|
@@ -524,7 +535,7 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
- message: '播放成功'
|
|
|
|
|
|
+ message: this.$t('broadcast.playbackSuccessful')
|
|
})
|
|
})
|
|
row.playing = true
|
|
row.playing = true
|
|
this.gridApi.redrawRows()
|
|
this.gridApi.redrawRows()
|
|
@@ -697,8 +708,12 @@ export default {
|
|
this.formmodel.part_id = this.$store.getters.partId
|
|
this.formmodel.part_id = this.$store.getters.partId
|
|
//判断 janus 是否连接状态
|
|
//判断 janus 是否连接状态
|
|
if (this.janus === null) {
|
|
if (this.janus === null) {
|
|
- this.connect(this.rtcServer)
|
|
|
|
- this.$message.error('重新连接,请再次点击保存')
|
|
|
|
|
|
+ if (this.rtcServer === null || this.rtcServer === ""){
|
|
|
|
+ this.getRtcServer()
|
|
|
|
+ } else {
|
|
|
|
+ this.connect(this.rtcServer)
|
|
|
|
+ }
|
|
|
|
+ this.$message.error(this.$t('action.saveAgain'))
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -708,7 +723,7 @@ export default {
|
|
if (result.id) {
|
|
if (result.id) {
|
|
this.createStreaming(result.id, result.audio_port);
|
|
this.createStreaming(result.id, result.audio_port);
|
|
} else {
|
|
} else {
|
|
- this.$message.error('保存失败')
|
|
|
|
|
|
+ this.$message.error(this.$t('action.saveFailed'))
|
|
return
|
|
return
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -806,7 +821,7 @@ export default {
|
|
this.streamingStop(false)
|
|
this.streamingStop(false)
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
- message: '试听结束'
|
|
|
|
|
|
+ message: this.$t('broadcast.auditionEnd')
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -836,8 +851,8 @@ export default {
|
|
this.attachPlugin()
|
|
this.attachPlugin()
|
|
},
|
|
},
|
|
error: (error) => {
|
|
error: (error) => {
|
|
- console.log('加载广播插件失败', error)
|
|
|
|
- _this.$alert('加载广播插件失败','系统提示',{
|
|
|
|
|
|
+ console.log(this.$t('broadcast.broadcastLoadFailed'), error)
|
|
|
|
+ _this.$alert(this.$t('broadcast.broadcastLoadFailed'), this.$t('action.systemPrompt'),{
|
|
confirmButtonText: this.$t('action.yes'),
|
|
confirmButtonText: this.$t('action.yes'),
|
|
callback: action => {
|
|
callback: action => {
|
|
_this.janus = null
|
|
_this.janus = null
|
|
@@ -862,7 +877,7 @@ export default {
|
|
},
|
|
},
|
|
error: function(error) {
|
|
error: function(error) {
|
|
console.log(" -- Error attaching plugin... ", error)
|
|
console.log(" -- Error attaching plugin... ", error)
|
|
- this.$alert('广播插件错误:' + error,'系统提示')
|
|
|
|
|
|
+ this.$alert(this.$t('broadcast.broadPlugInError') + error, this.$t('action.systemPrompt'))
|
|
},
|
|
},
|
|
iceState: function(state) {
|
|
iceState: function(state) {
|
|
console.log("ICE state changed to " + state)
|
|
console.log("ICE state changed to " + state)
|
|
@@ -969,7 +984,7 @@ export default {
|
|
// streaming: "created"
|
|
// streaming: "created"
|
|
console.log('result===', result)
|
|
console.log('result===', result)
|
|
if(!result) {
|
|
if(!result) {
|
|
- _this.$alert('系统无返回消息!', '系统提示', {
|
|
|
|
|
|
+ _this.$alert(this.$t('action.systemNoReturnMessage'), this.$t('action.systemPrompt'), {
|
|
confirmButtonText: this.$t('action.yes'),
|
|
confirmButtonText: this.$t('action.yes'),
|
|
callback: action => {
|
|
callback: action => {
|
|
}
|
|
}
|
|
@@ -994,7 +1009,7 @@ export default {
|
|
if(!result) {
|
|
if(!result) {
|
|
_this.$message({
|
|
_this.$message({
|
|
type: 'error',
|
|
type: 'error',
|
|
- message: '未能得到返回消息!'
|
|
|
|
|
|
+ message: this.$t('action.failedGetReturnMessage')
|
|
})
|
|
})
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -1024,6 +1039,23 @@ export default {
|
|
},
|
|
},
|
|
onCleanup() {
|
|
onCleanup() {
|
|
this.stream = null
|
|
this.stream = null
|
|
|
|
+ },
|
|
|
|
+ getRtcServer() {
|
|
|
|
+ API_ServiceInfo.getServiceInfo().then(r => {
|
|
|
|
+ const result = r
|
|
|
|
+ console.log("result", result)
|
|
|
|
+ this.rtcServer = "ws://" + r.rtc_public_ip + ":" + r.rtc_port + "/janus"
|
|
|
|
+
|
|
|
|
+ Janus.init({
|
|
|
|
+ debug: false,
|
|
|
|
+ dependencies: Janus.useDefaultDependencies(),
|
|
|
|
+ callback: () => {
|
|
|
|
+ if (this.rtcServer !== null && this.rtcServer !== "") {
|
|
|
|
+ this.connect(this.rtcServer)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|