|
@@ -76,13 +76,13 @@ export default {
|
|
|
if(!hookHost){
|
|
|
hookHost = "szgpay.ticp.net:29010"
|
|
|
}
|
|
|
- let app = "broadcast";
|
|
|
- let stream = `audio${this.deviceId}`
|
|
|
+ let app = "rtc";
|
|
|
+ let stream = `${this.deviceId}`
|
|
|
let zlmSdpUrl = `/zlmServer/index/api/webrtc?app=${app}&stream=${stream}&type=push&sign=${pushKey}`;
|
|
|
|
|
|
let ffmpegStreamId = `ff_audio${this.deviceId}`
|
|
|
let audioStreamUrl = `webrtc://${hookHost}/${app}/${stream}`
|
|
|
- let dstUrl = `rtsp://127.0.0.1/${app}/${ffmpegStreamId}`;
|
|
|
+ let dstUrl = `rtsp://127.0.0.1:11554/${app}/${ffmpegStreamId}`;
|
|
|
let playAudioStreamUrl = `https://192.168.1.203:29010/index/api/webrtc?app=${app}&stream=${stream}&type=play`;
|
|
|
console.log(audioStreamUrl)
|
|
|
console.log(playAudioStreamUrl)
|
|
@@ -95,10 +95,10 @@ export default {
|
|
|
// enable_mp4 Y 是否开启mp4录制
|
|
|
// ffmpeg_cmd_key
|
|
|
let addFFmpegSourceData = {
|
|
|
- secret:"",
|
|
|
+ secret:"035c73f7-bb6b-4889-a715-d9eb2d1925cc",
|
|
|
src_url: audioStreamUrl,
|
|
|
dst_url: dstUrl,
|
|
|
- timeout_ms: 30,
|
|
|
+ timeout_ms: 15000,
|
|
|
enable_hls: 0,
|
|
|
enable_mp4: 0,
|
|
|
}
|
|
@@ -131,19 +131,34 @@ export default {
|
|
|
console.log('当前状态==>',state);
|
|
|
console.log(ffmpegStreamProxyUrl);
|
|
|
if(state === 'connected'){
|
|
|
- // 连接成功添加ffmpeg 推流代理
|
|
|
- [err,res] = await handle(this.$axios({
|
|
|
- method: 'post',
|
|
|
- url: ffmpegStreamProxyUrl,
|
|
|
- data:addFFmpegSourceData
|
|
|
- }));
|
|
|
+ console.log(player);
|
|
|
+ console.log(player._localStream.id);
|
|
|
+ if(player._localStream && player._localStream.id){
|
|
|
+ stream = player._localStream.id;
|
|
|
+ }
|
|
|
+ [err,res] = await handle(this.sendBroaderCast(stream));
|
|
|
+
|
|
|
if(err){
|
|
|
this.$message.error(err.message);
|
|
|
- console.log("[创建拉流代理] ")
|
|
|
+ console.log("[发送broadCast信息] 失败")
|
|
|
console.log(err);
|
|
|
+ player.close();
|
|
|
}
|
|
|
- console.log(res);
|
|
|
- [err,res] = await handle(this.sendBroaderCast(ffmpegStreamId));
|
|
|
+
|
|
|
+ // 连接成功添加ffmpeg 推流代理
|
|
|
+ // [err,res] = await handle(this.$axios({
|
|
|
+ // baseURL: "/",
|
|
|
+ // method: 'post',
|
|
|
+ // url: ffmpegStreamProxyUrl,
|
|
|
+ // data:addFFmpegSourceData
|
|
|
+ // }));
|
|
|
+ // if(err){
|
|
|
+ // this.$message.error(err.message);
|
|
|
+ // console.log("[创建拉流代理] ")
|
|
|
+ // console.log(err);
|
|
|
+ // }
|
|
|
+ // console.log(res);
|
|
|
+
|
|
|
|
|
|
}else{
|
|
|
|
|
@@ -211,7 +226,9 @@ export default {
|
|
|
|
|
|
console.log(res);
|
|
|
if(response.code !== 0){
|
|
|
- return this.$message.error(response.msg)
|
|
|
+ this.player.close();
|
|
|
+ return this.$message.error(response.msg);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|