I am playing an audio with audioplayers. Nonetheless, I get this error:
V/MediaPlayer(13566): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(13566): cleanDrmObj: mDrmObj=null mDrmSessionId=null
V/MediaPlayer(13566): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(13566): cleanDrmObj: mDrmObj=null mDrmSessionId=null
V/MediaPlayer(13566): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(13566): cleanDrmObj: mDrmObj=null mDrmSessionId=null
V/MediaHTTPService(13566): MediaHTTPService(android.media.MediaHTTPService@5069e1b): Cookies: null
V/MediaHTTPService(13566): makeHTTPConnection: CookieHandler (java.net.CookieManager@f9da40) exists.
V/MediaHTTPService(13566): makeHTTPConnection(android.media.MediaHTTPService@5069e1b): cookieHandler: java.net.CookieManager@f9da40 Cookies: null
Soon after this appears on the screen:
E/flutter (13566): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: TimeoutException after 0:00:30.000000: Future not completed
E/flutter (13566):
E/MediaPlayerNative(13566): error (1, -2147483648)
E/MediaPlayer(13566): Error (1,-2147483648)
V/MediaPlayer(13566): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(13566): cleanDrmObj: mDrmObj=null mDrmSessionId=null
V/MediaPlayer(13566): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(13566): cleanDrmObj: mDrmObj=null mDrmSessionId=null
I/flutter (13566): AudioPlayers Exception: AudioPlayerException(
I/flutter (13566): UrlSource(url: https://file-examples.com/storage/fe1dbaea7664d369bb6e226/2017/11/file_example_MP3_700KB.mp3),
I/flutter (13566): PlatformException(MEDIA_ERROR_UNKNOWN {what:1}, MEDIA_ERROR_SYSTEM, null, null)
And the code is simply a call to the audio's URL:
class MyWidget extends StatefulWidget {
const MyWidget({super.key});
@override
State<MyWidget> createState() => _MyWidgetState();
}
class _MyWidgetState extends State<MyWidget> {
@override
void initState() {
super.initState();
AudioPlayer().play(UrlSource(
"https://file-examples.com/storage/fe1dbaea7664d369bb6e226/2017/11/file_example_MP3_700KB.mp3"));
}
@override
Widget build(BuildContext context) {
return const Placeholder();
}
}
What should I do to fix it? Where is the bug coming from?
I am using an Android emulator: Pixel 2 (R) API 30. Latest Dart, Flutter, and audioplayers versions.
Note: https://file-examples.com/storage/fe1dbaea7664d369bb6e226/2017/11/file_example_MP3_700KB.mp3 is the link for a random audio file I found on the Internet. Looking for more, the single same error happens, so it cannot be the source.