cordova-plugin-media icon indicating copy to clipboard operation
cordova-plugin-media copied to clipboard

MediaError.MEDIA_ERR_ABORTED = 1 on Android?

Open diegodotta opened this issue 7 years ago • 15 comments

Anyone knows what does it mean this error? iOS is working fine but Android is not playing the audio and showing this error.

I'm using Cordova 8, Cordova Android 7.1 and Plugin 5.0.2 I've tried M4A and MP3 files.

diegodotta avatar Sep 24 '18 22:09 diegodotta

I have the same problem. Have you found a solution yet?

gabrieldutra18 avatar Sep 28 '18 14:09 gabrieldutra18

Running the application on Android 8, and fetch the audio from remote (Firebase) show media error code 1. But it's work fine when running on android 4.4

mattlin4567 avatar Oct 08 '18 02:10 mattlin4567

I met the same problem,the callback return err {code : 1} after play the remote mp3 file several times

imgoddqp avatar Feb 23 '19 07:02 imgoddqp

mp3 file in assets folder, same problem, while mp3 downloaded from remote, works great.

Cordova 8.0, Android 9

giacomocerquone avatar Apr 20 '19 16:04 giacomocerquone

Solved, you need to prefix it with: "/android_asset/www/assets/file.mp3" (i was putting it in the assets folder). While in ios you can just reference "assets/file.mp3".

Have a good day ;)

giacomocerquone avatar Apr 20 '19 16:04 giacomocerquone

@giacomocerquone This really worked! Thanks

bergergit avatar Apr 26 '19 18:04 bergergit

@giacomocerquone thanks for the solution, worked for me as well. Should this "/android_asset/www/asset/file.mp3" vs "asset/file.mp3" difference be in the documentation? Caught me out whilst using this library.

MumblesNZ avatar Jun 21 '19 04:06 MumblesNZ

If someone pass by, i have the same problem but the problem occur with downloaded sound on my app, so android_assets/ is no use since it's saved somewhere like file:///data/user/0/com.[APPNAME].app/files/Audios/1320q.mp3

FatManiac avatar Jul 25 '19 09:07 FatManiac

@FatManiac just inspect it with the android studio filebrowser or constantly keep calling filebrowser functions from cordova to search for your file

giacomocerquone avatar Jul 25 '19 09:07 giacomocerquone

I have the same problem with a downloaded file in cordova 8.1.2 and android 8 file:///storage/emulated/0/download/fileName.mp3 directory should be fine but I'm getting the infamous code 1

michug avatar Dec 17 '19 03:12 michug

After using the stop method, call the method release(), https://developer.android.com/reference/android/media/MediaPlayer

molimpio avatar Jan 24 '20 12:01 molimpio

Hello I am also facing same problem when create media object from https url that time I get this error and in http url its working so please any one is help me Thanks in advance!

hardslk avatar Aug 25 '20 12:08 hardslk

If someone pass by, i have the same problem but the problem occur with downloaded sound on my app, so android_assets/ is no use since it's saved somewhere like file:///data/user/0/com.[APPNAME].app/files/Audios/1320q.mp3

@FatManiac I'm stuck at the same problem. Did you found any solution yet?

mayankkataria avatar Jan 28 '21 09:01 mayankkataria

@mayankkataria I'm also stuck on the same problem. Have you found any solution?

sandzOfTime avatar Feb 04 '21 02:02 sandzOfTime

@mayankkataria Not sure if you solved it yet. But what ended up working for me was inserting android:requestLegacyExternalStorage="true within my <application> tag.

sandzOfTime avatar Feb 07 '21 01:02 sandzOfTime