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