Remove debug print statements from audio player for cleaner code. deploy now
This commit is contained in:
@@ -1191,8 +1191,7 @@ class _FileExplorerState extends State<FileExplorer>
|
||||
filePath: file.path,
|
||||
fileName: file.name,
|
||||
);
|
||||
// ignore: avoid_print
|
||||
print('[FileExplorer] Audio URL: $url');
|
||||
|
||||
if (widget.onAudioFileSelected != null) {
|
||||
widget.onAudioFileSelected!(file.name, url);
|
||||
}
|
||||
|
||||
@@ -62,9 +62,6 @@ class _AudioPlayerBarState extends State<AudioPlayerBar>
|
||||
|
||||
String? _errorMsg;
|
||||
Future<void> _initAudio() async {
|
||||
// Log the file URL for debugging
|
||||
// ignore: avoid_print
|
||||
print('[AudioPlayerBar] Loading audio URL: ${widget.fileUrl}');
|
||||
try {
|
||||
await _audioPlayer.setUrl(widget.fileUrl);
|
||||
|
||||
@@ -101,8 +98,6 @@ class _AudioPlayerBarState extends State<AudioPlayerBar>
|
||||
_errorMsg = error.toString();
|
||||
_isLoading = false;
|
||||
});
|
||||
// ignore: avoid_print
|
||||
print('[AudioPlayerBar] Web audio error: $error');
|
||||
});
|
||||
|
||||
// Auto-play for web
|
||||
@@ -128,18 +123,14 @@ class _AudioPlayerBarState extends State<AudioPlayerBar>
|
||||
setState(() {
|
||||
_errorMsg = 'Audio could not be played.';
|
||||
});
|
||||
// ignore: avoid_print
|
||||
print('[AudioPlayerBar] ERROR: Audio could not be played.');
|
||||
}
|
||||
});
|
||||
} catch (e, st) {
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
_errorMsg =
|
||||
'Audio playback error: ' +
|
||||
(e is Exception ? e.toString() : 'Unknown error');
|
||||
});
|
||||
// ignore: avoid_print
|
||||
print('[AudioPlayerBar] Playback error: $e\n$st');
|
||||
}
|
||||
});
|
||||
_audioPlayer.positionStream.listen((pos) {
|
||||
@@ -160,15 +151,13 @@ class _AudioPlayerBarState extends State<AudioPlayerBar>
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e, st) {
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_errorMsg =
|
||||
'Audio load error: ' +
|
||||
(e is Exception ? e.toString() : 'Unknown error');
|
||||
});
|
||||
// ignore: avoid_print
|
||||
print('[AudioPlayerBar] Load error: $e\n$st');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user