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, label: '挂断'.tr,
color: Colors.red, color: Colors.red,
onTap: () async { onTap: () async {
logic.stopProcessing(); // logic.stopProcessing();
CallTalk().finishAVData(); // CallTalk().finishAVData();
if (!state.isClickHangUp.value) { if (!state.isClickHangUp.value) {
// logic.initiateUdpHangUpAction(3); // logic.initiateUdpHangUpAction(3);
logic.initiateHangUpCommand(); logic.initiateHangUpCommand();

View File

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

View File

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

View File

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

View File

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