fix: 1,修复接听、挂断铃声未取消问题

2,修复挂断后未退出对讲问题
This commit is contained in:
“DaisyWu” 2024-12-10 18:33:32 +08:00
parent 343e9c101a
commit 1e9d68be6e
5 changed files with 9 additions and 4 deletions

View File

@ -155,8 +155,9 @@ class _LockMonitoringPageState extends State<LockMonitoringPage> {
label: '挂断'.tr,
color: Colors.red,
onTap: () async {
logic.stopProcessing();
CallTalk().finishAVData();
// logic.stopProcessing();
// CallTalk().finishAVData();
if (!state.isClickHangUp.value) {
// logic.initiateUdpHangUpAction(3);
logic.initiateHangUpCommand();

View File

@ -90,6 +90,7 @@ class StarChartLogic extends BaseGetXController {
//
StartChartManage().sendTalkRejectMessage();
}
Get.back();
}
Future<void> _onFrame(List<int> frame) async {

View File

@ -17,7 +17,6 @@ class AudioPlayerManager {
// AudioPlayer
final AudioPlayer _audioPlayer = AudioPlayer();
//
Future<void> playRingtone() async {
try {
@ -33,7 +32,9 @@ class AudioPlayerManager {
Future<void> stopRingtone() async {
try {
// ReleaseMode
_audioPlayer.setReleaseMode(ReleaseMode.loop);
await _audioPlayer.stop();
log(text: 'Ringtone stopped.');
} catch (e) {
log(text: 'Error stopping ringtone: $e');

View File

@ -34,6 +34,7 @@ class UdpTalkAcceptHandler extends ScpMessageBaseHandle
_handleStartSendTalkExpectDataRequest();
//
talkStatus.setDuringCall();
stopRingtone();
}
}

View File

@ -23,6 +23,7 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
startChartManage.stopTalkPingMessageTimer();
startChartManage.stopTalkExpectMessageTimer();
talkStatus.setEnd();
stopRingtone();
}
@override
@ -32,7 +33,7 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
startChartManage.stopTalkPingMessageTimer();
startChartManage.stopTalkExpectMessageTimer();
talkStatus.setEnd();
stopRingtone();
}
@override