Ios Stream Audio

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

@ -1202,19 +1202,35 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void startRecoding() async {
PermissionStatus status = await Permission.microphone.request();
if (status.isDenied == true) {
if (status.isDenied) {
startRecoding();
} else if (status.isGranted) {
sRecoding();
} else {
isVoiceMsg = true;
recorderController.reset();
await recorderController.record(path);
_recodeDuration = 0;
_startTimer();
isRecoding = !isRecoding;
notifyListeners();
startRecoding();
}
}
// else {
// isVoiceMsg = true;
// recorderController.reset();
// await recorderController.record(path);
// _recodeDuration = 0;
// _startTimer();
// isRecoding = !isRecoding;
// notifyListeners();
// }
void sRecoding() async {
isVoiceMsg = true;
recorderController.reset();
await recorderController.record(path);
_recodeDuration = 0;
_startTimer();
isRecoding = !isRecoding;
notifyListeners();
}
Future<void> _startTimer() async {
_timer?.cancel();
_timer = Timer.periodic(const Duration(seconds: 1), (Timer t) async {

Loading…
Cancel
Save