This commit is contained in:
杨航
2025-11-26 20:51:26 +08:00
parent 8c8f6529c6
commit 4eaddcfc1c
7 changed files with 149 additions and 130 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ ENV = 'development'
# VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
@@ -23,7 +23,7 @@ VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786'
# DEV
# app入口
# VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
# VITE_APP_BASE_API_Url = 'http://25.16.122.91:9786'
# VITE_APP_BASE_API_Url = 'http://25.18.122.66:9786'
+1 -1
View File
@@ -4,7 +4,7 @@ ENV = 'development.yh'
VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.32.154:9604'
# VITE_APP_BASE_H5_API_Url_TRAPRACTICE = 'http://25.64.32.156:9603'
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.32.154:9601'
+2 -1
View File
@@ -35,7 +35,8 @@
"Camera" : {},
"Barcode" : {},
"Record" : {},
"VideoPlayer" : {}
"VideoPlayer" : {},
"LivePusher" : {}
},
/* */
"distribute" : {
+6 -1
View File
@@ -250,7 +250,7 @@
isLoading.value = false
setTimeout(() => {
showLoading.value = false
if(isPass.value && isOver.value){
if(isPass.value && isOver.value && canLoad.value){
pointAndBadgesRun(talkingType.value === '01' ? '07': '08', '', ()=>{})
}
}, 800)
@@ -280,7 +280,9 @@
common.navigateBack()
}
}
const canLoad= ref(false)
onLoad((params) => {
canLoad.value= true
traId.value = params.traId;
execId.value = params.execId
talkingType.value = params.type;
@@ -289,6 +291,9 @@
isOver.value = params.isOver === '1'
getData()
});
onUnload(()=>{
canLoad.value= false
})
onMounted(() => {})
onBackPress((res) => res.from === 'backbutton');
</script>
+1 -1
View File
@@ -2,5 +2,5 @@
<talkCom/>
</template>
<script setup>
import talkCom from './talkCom.vue'
import talkCom from './talkCom.nvue'
</script>
+137
View File
@@ -0,0 +1,137 @@
<template>
<view>
<!-- <video :is-live="true" :src="videoSrc" :autoplay="true" @error="error"></video> -->
<live-pusher
id="pusher-box"
:enable-camera="false"></live-pusher>
<button class="btn" @click="prepare">预热</button>
<button class="btn" @click="start">开始推流1</button>
<button class="btn" @click="pause">暂停推流</button>
<button class="btn" @click="resume">恢复</button>
<button class="btn" @click="stop">停止推流</button>
<!-- <button class="btn" @click="snapshot">快照</button>
<button class="btn" @click="startPreview">开启摄像头预览1</button>
<button class="btn" @click="stopPreview">关闭摄像头预览</button>
<button class="btn" @click="switchCamera">切换摄像头</button> -->
</view>
</template>
<script >
import {
prepareApi
} from "@/api/talk.js";
var pusher = null;
export default {
data() {
return {
baseName: 'wangwu',
context: null
}
},
computed: {
videoSrc() {
return 'rtmp://25.18.122.148:9605/voice_out/' + this.baseName;
},
},
methods: {
statechange(e) {
console.log('statechange:', e, JSON.stringify(e));
},
netstatus(e) {
console.log('netstatus:' + JSON.stringify(e));
},
error(e) {
console.log('error:' + JSON.stringify(e));
},
start() {
console.log('start');
console.log('start', pusher.start);
pusher.start(a => {
console.log('livePusher.start:');
}, b => {
console.log('livePusher.start.err:');
}
);
},
close() {
pusher.close({
success: a => {
console.log('livePusher.close:' + JSON.stringify(a));
}
});
},
snapshot() {
pusher.snapshot({
success: e => {
console.log(JSON.stringify(e));
}
});
},
resume() {
pusher.resume({
success: e => {
console.log(JSON.stringify(e));
}
});
},
pause() {
pusher.pause({
success: a => {
console.log('livePusher.pause:' + JSON.stringify(a))
}
})
},
stop() {
pusher.stop({
success: a => {
console.log(JSON.stringify(a))
}
})
},
switchCamera() {
pusher.switchCamera({
success: a => {
console.log('livePusher.switchCamera:' + JSON.stringify(a))
}
})
},
startPreview() {
pusher.startPreview({
success: a => {
console.log('livePusher.startPreview:' + JSON.stringify(a))
}
})
},
stopPreview() {
pusher.stopPreview({
success: a => {
console.log('livePusher.stopPreview:' + JSON.stringify(a))
}
})
},
prepare() {
prepareApi(this.baseName).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
if (err === 'prepare') {
this.initPusher()
}
})
},
initPusher() {
console.log(1)
pusher = new plus.video.LivePusher('pusher-box', {
url: 'rtmp://25.18.122.148:9605/voice_in/' + this.baseName,
"enable-camera": false,
"min-bitrate": 16,
"max-bitrate": 16,
})
pusher.addEventListener('statechange', this.statechange)
pusher.addEventListener('netstatus', this.netstatus)
pusher.addEventListener('error', this.error)
console.log(pusher)
}
}
}
</script>
-124
View File
@@ -1,124 +0,0 @@
<template>
<view>
<video :is-live="true" :src="videoSrc" :autoplay="true" @error="error"></video>
<view id="pusher-box" class="pusher-box"></view>
<button class="btn" @click="start">开始推流1</button>
<button class="btn" @click="pause">暂停推流</button>
<button class="btn" @click="resume">预热</button>
<button class="btn" @click="stop">停止推流</button>
<button class="btn" @click="snapshot">快照</button>
<button class="btn" @click="startPreview">开启摄像头预览1</button>
<button class="btn" @click="stopPreview">关闭摄像头预览</button>
<button class="btn" @click="switchCamera">切换摄像头</button>
</view>
</template>
<script>
// import {
// prepareApi
// } from "@/api/talk.js";
// var pusher;
// export default ({
// data() {
// return {
// baseName: 'zhangsan',
// context: null
// }
// },
// computed: {
// videoSrc() {
// return 'rtmp://25.18.122.148:9605/voice_out/' + this.baseName;
// },
// },
// onReady() {},
// methods: {
// statechange(e) {
// console.log('statechange:', e, JSON.stringify(e));
// },
// netstatus(e) {
// console.log('netstatus:' + JSON.stringify(e));
// },
// error(e) {
// console.log('error:' + JSON.stringify(e));
// },
// start: function() {
// console.log('start');
// console.log('start', pusher.start);
// pusher.start(a => {
// console.log('livePusher.start:');
// }, b => {
// console.log('livePusher.start.err:');
// });
// },
// close: function() {
// pusher.close({
// success: a => {
// console.log('livePusher.close:' + JSON.stringify(a));
// }
// });
// },
// snapshot: function() {
// pusher.snapshot({
// success: e => {
// console.log(JSON.stringify(e));
// }
// });
// },
// resume: function() {
// prepareApi(this.baseName).then(res => {
// console.log(res)
// }).catch(err => {
// console.log(err)
// if (err === 'prepare') {
// this.initPusher()
// }
// })
// },
// pause: function() {
// pusher.pause({
// success: a => {
// console.log('livePusher.pause:' + JSON.stringify(a))
// }
// })
// },
// stop: function() {
// pusher.stop({
// success: a => {
// console.log(JSON.stringify(a))
// }
// })
// },
// switchCamera: function() {
// pusher.switchCamera({
// success: a => {
// console.log('livePusher.switchCamera:' + JSON.stringify(a))
// }
// })
// },
// startPreview: function() {
// pusher.startPreview({
// success: a => {
// console.log('livePusher.startPreview:' + JSON.stringify(a))
// }
// })
// },
// stopPreview: function() {
// pusher.stopPreview({
// success: a => {
// console.log('livePusher.stopPreview:' + JSON.stringify(a))
// }
// })
// },
// initPusher() {
// console.log(1)
// pusher = new plus.video.LivePusher('pusher-box', {
// url: 'rtmp://25.18.122.148:9605/voice_in/' + this.baseName,
// "enable-camera": false
// })
// pusher.addEventListener('statechange', this.statechange)
// pusher.addEventListener('netstatus', this.netstatus)
// pusher.addEventListener('error', this.error)
// console.log(pusher)
// }
// }
// })
</script>