This commit is contained in:
2025-12-12 17:30:54 +08:00
parent b1f9d3f4f7
commit 9699e6ee57
5 changed files with 9 additions and 770 deletions

View File

@ -87,8 +87,6 @@ const showPushlVideo = ref(false);
const speakers = ref([]);
const codeId = ref(null)
// 54040254001310305009 视频
// 38467417 对讲机
const keyWoed = ref('38467417') //关键字
@ -126,17 +124,11 @@ const handleBtn = (type) =>{
switch(type){
case '无人机':
let obj = { basedata_id , video_frame_size: 3, hook_flag: 0 }
window.lemon.call.makeVideoCall(obj)?.then((resp) => {
console.log('无人机', resp);
codeId.value = resp.call_id
});
CALL.makeVideoCall(obj)
break;
case '对讲机':
let obj1 = { basedata_id,"hook_flag":0,"duplex_flag":0 }
CALL.makeVoiceCall(obj1)
// window.lemon.call.makeVoiceCall(obj1)?.then((resp) => {
// codeId.value = resp.call_id
// });
break;
}
}
@ -147,7 +139,6 @@ const handleBtn = (type) =>{
// register media stream callbackinclude audio and video stream
const registerStream = () => {
streamCbId = window.lemon.call.addMediaStream((call_id, stream, type) => {
console.log(type,'============监听播放类型');
rootView.style.display = 'unset';
if (type === 'audio_dst') {
setAudio(stream);
@ -244,13 +235,14 @@ const registerGrantEvent = () => {
const close = () => {
console.log('=======关闭');
if (rootView) rootView.style.display = 'none';
if (rootView) {
emit('update:modelValue',false)
rootView.style.display = 'none';
}
};
const applayFloor = () => {
const index = speakers.value?.findIndex((item) => item.number === baseInfo.basedata_id);
console.log( index,'-1','=== speakers.value');
const index = speakers.value?.findIndex((item) => item.number === baseInfo.user_id);
if (index >= 0) {
CALL.releaseFloor();
} else {
@ -260,7 +252,7 @@ const applayFloor = () => {
const hangup = () => {
emit('update:modelValue',false)
CALL.hangup(codeId.value);
CALL.hangup();
};
const initWave = () => {

View File

@ -159,7 +159,7 @@ const Init = () => {
if (!token) {
let userInfo = {
username: "sgxtcs",
password: "sgxtcs",
password: "123456",
realm: "puc.com",
webpucUrl: "https://89.40.9.95:16888"
};

View File

@ -32,7 +32,7 @@ export default function useCallModule() {
const makeVoiceCall = (record ) => {
if (call_id) return;
window.lemon.call.makeVoiceCall({ basedata_id: record.basedata_id, hook_flag: 0 })?.then((resp) => {
window.lemon.call.makeVoiceCall({ basedata_id: record.basedata_id, hook_flag: 0 , duplex_flag:0})?.then((resp) => {
call_id = resp.call_id;
});
};
@ -145,9 +145,7 @@ export default function useCallModule() {
* hangup call
*/
const hangup = (id) => {
console.log(id,'=====挂断');
window.lemon.call.hangupCall({ call_id: id || call_id })?.then(() => {
console.log('00000000000=====挂断');
call_id = undefined;
window.calling_conference = undefined;
})