Ios Stream Audio

merge-requests/131/head
Aamir Muhammad 3 years ago
parent 16ea3b7c66
commit 83b8691a31

@ -1202,9 +1202,26 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void startRecoding() async { void startRecoding() async {
PermissionStatus status = await Permission.microphone.request(); PermissionStatus status = await Permission.microphone.request();
if (status.isDenied == true) { if (status.isDenied) {
startRecoding(); startRecoding();
} else if (status.isGranted) {
sRecoding();
} else { } else {
startRecoding();
}
}
// else {
// isVoiceMsg = true;
// recorderController.reset();
// await recorderController.record(path);
// _recodeDuration = 0;
// _startTimer();
// isRecoding = !isRecoding;
// notifyListeners();
// }
void sRecoding() async {
isVoiceMsg = true; isVoiceMsg = true;
recorderController.reset(); recorderController.reset();
await recorderController.record(path); await recorderController.record(path);
@ -1213,7 +1230,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isRecoding = !isRecoding; isRecoding = !isRecoding;
notifyListeners(); notifyListeners();
} }
}
Future<void> _startTimer() async { Future<void> _startTimer() async {
_timer?.cancel(); _timer?.cancel();

Loading…
Cancel
Save