声音优化--视频对讲和监控

This commit is contained in:
sky_min 2025-12-11 11:41:39 +08:00
parent aae65dbfad
commit f19f8f72ec
4 changed files with 10 additions and 2 deletions

View File

@ -927,7 +927,7 @@ class LockDetailLogic extends BaseGetXController {
//
// PacketLossStatistics().reset();
// id -
StartChartManage().startCallRequestMessageTimer(ToPeerId: network!.peerId ?? '', isMonitoring: true);
StartChartManage().startCallRequestMessageTimer(ToPeerId: network!.peerId ?? '');
} else {
showToast('猫眼设置为省电模式时无法进行监控,请在猫眼设置中切换为其他模式'.tr);
}

View File

@ -63,7 +63,7 @@ class UdpTalkExpectHandler extends ScpMessageBaseHandle
talkStatus.setAnsweredSuccessfully();
// ping
startChartManage.startTalkPingMessageTimer();
} else if (talkStatus.status != TalkStatus.answeredSuccessfully) {
} else if (talkStatus.status != TalkStatus.answeredSuccessfully && !startChartManage.isMonitoring) {
playRingtone();
}
AppLog.log(

View File

@ -98,6 +98,10 @@ class ScpMessageBaseHandle {
//
void playRingtone() async {
//
if (startChartManage.isMonitoring) {
return;
}
//test:使
await audioManager.playRingtone();
}

View File

@ -94,6 +94,7 @@ class StartChartManage {
final String echoPeerId = '3phX8Ng2cZHz5NtP8xAf6nYy2z1BYytoejgjoHrWMGhH';
bool isOnlineStarChartServer = false; // 线
bool isMonitoring = false; //
Timer? reStartOnlineStartChartServerTimer; // 线
Timer? talkPingTimer; //
Timer? talkExpectTimer; //
@ -437,6 +438,7 @@ class StartChartManage {
// ToPeerId为当前要连接的锁的peerId
this.ToPeerId = ToPeerId;
this.lockPeerId = ToPeerId;
this.isMonitoring = isMonitoring;
//
// if (talkStatus.status != TalkStatus.proactivelyCallWaitingAnswer) {
// // h264则跳转至webview
@ -492,6 +494,8 @@ class StartChartManage {
void stopCallRequestMessageTimer() async {
talkRequestTimer?.cancel();
talkRequestTimer = null;
//
isMonitoring = false;
}
//