Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audioplayer doesn't start #28

Closed
klinki opened this issue Aug 4, 2018 · 6 comments
Closed

Audioplayer doesn't start #28

klinki opened this issue Aug 4, 2018 · 6 comments

Comments

@klinki
Copy link

klinki commented Aug 4, 2018

Hello,

I have a problem with audioplayer. It doesn't start playing and calls onComplete callback right away.

Here is log, if it helps:

Launching lib\main.dart on GT I9195 in debug mode...
C:\Users\david\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\audioplayers-0.7.3\android\src\main\java\xyz\luan\audioplayers\WrappedMediaPlayer.java:204: warning: [deprecation] setAudioStreamType(int) in MediaPlayer has been deprecated
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
^
1 warning
Built build\app\outputs\apk\debug\app-debug.apk.
I/FlutterActivityDelegate(25121): onResume setting current activity to this
I/Choreographer(25121): Skipped 94 frames! The application may be doing too much work on its main thread.
E/dalvikvm(25121): Could not find class 'android.media.AudioAttributes$Builder', referenced from method xyz.luan.audioplayers.WrappedMediaPlayer.createPlayer
W/dalvikvm(25121): VFY: unable to resolve new-instance 38 (Landroid/media/AudioAttributes$Builder;) in Lxyz/luan/audioplayers/WrappedMediaPlayer;
D/dalvikvm(25121): VFY: replacing opcode 0x22 at 0x0012
D/dalvikvm(25121): DexOpt: unable to opt direct call 0x004e at 0x14 in Lxyz/luan/audioplayers/WrappedMediaPlayer;.createPlayer
V/MediaPlayer-JNI(25121): native_setup
V/MediaPlayer(25121): constructor
V/MediaPlayer(25121): setListener
V/MediaPlayer-JNI(25121): setAudioStreamType: 3
V/MediaPlayer(25121): MediaPlayer::setAudioStreamType
V/MediaPlayer-JNI(25121): setVolume: left 1.000000 right 1.000000
V/MediaPlayer(25121): MediaPlayer::setVolume(1.000000, 1.000000)
V/MediaPlayer-JNI(25121): setLooping: 0
V/MediaPlayer(25121): MediaPlayer::setLooping
V/MediaPlayer(25121): message received msg=8, ext1=0, ext2=0
V/MediaPlayer(25121): notify(8, 0, 0) callback on disconnected mediaplayer
V/MediaPlayer-JNI(25121): setVolume: left 1.000000 right 1.000000
V/MediaPlayer(25121): MediaPlayer::setVolume(1.000000, 1.000000)
V/MediaPlayer-JNI(25121): setLooping: 0
V/MediaPlayer(25121): MediaPlayer::setLooping
V/MediaPlayer(25121): setVideoSurfaceTexture
V/MediaPlayer(25121): prepareAsync
V/MediaPlayer(25121): message received msg=100, ext1=1, ext2=-1004
E/MediaPlayer(25121): error (1, -1004)
V/MediaPlayer(25121): callback application
V/MediaPlayer(25121): back from callback
E/MediaPlayer(25121): Error (1,-1004)
V/MediaPlayer-JNI(25121): stop
V/MediaPlayer(25121): stop
E/MediaPlayer(25121): stop called in state 0
V/MediaPlayer(25121): message received msg=100, ext1=-38, ext2=0
E/MediaPlayer(25121): error (-38, 0)
V/MediaPlayer(25121): callback application
V/MediaPlayer(25121): back from callback
V/MediaPlayer-JNI(25121): reset
V/MediaPlayer(25121): reset
V/MediaPlayer(25121): message received msg=8, ext1=0, ext2=0
V/MediaPlayer(25121): notify(8, 0, 0) callback on disconnected mediaplayer
V/MediaPlayer-JNI(25121): release
V/MediaPlayer(25121): setListener
V/MediaPlayer(25121): disconnect
V/MediaPlayer(25121): destructor
V/MediaPlayer(25121): disconnect
I/flutter (25121): _platformCallHandler call audio.onComplete {value: true, playerId: 4e53b7f9-5f74-4001-bce7-bb3e666b6332}
V/MediaPlayer-JNI(25121): native_setup
V/MediaPlayer(25121): constructor
V/MediaPlayer(25121): setListener
V/MediaPlayer-JNI(25121): setAudioStreamType: 3
V/MediaPlayer(25121): MediaPlayer::setAudioStreamType
V/MediaPlayer-JNI(25121): setVolume: left 1.000000 right 1.000000
V/MediaPlayer(25121): MediaPlayer::setVolume(1.000000, 1.000000)
V/MediaPlayer-JNI(25121): setLooping: 0
V/MediaPlayer(25121): MediaPlayer::setLooping
V/MediaPlayer(25121): message received msg=8, ext1=0, ext2=0
V/MediaPlayer(25121): notify(8, 0, 0) callback on disconnected mediaplayer
V/MediaPlayer(25121): setVideoSurfaceTexture
V/MediaPlayer(25121): prepareAsync
V/MediaPlayer(25121): message received msg=100, ext1=1, ext2=-1004
E/MediaPlayer(25121): error (1, -1004)
V/MediaPlayer(25121): callback application
V/MediaPlayer(25121): back from callback
E/MediaPlayer(25121): Error (1,-1004)
V/MediaPlayer-JNI(25121): stop
V/MediaPlayer(25121): stop
E/MediaPlayer(25121): stop called in state 0
V/MediaPlayer(25121): message received msg=100, ext1=-38, ext2=0
E/MediaPlayer(25121): error (-38, 0)
V/MediaPlayer(25121): callback application
V/MediaPlayer(25121): back from callback
V/MediaPlayer-JNI(25121): reset
V/MediaPlayer(25121): reset
V/MediaPlayer(25121): message received msg=8, ext1=0, ext2=0
V/MediaPlayer(25121): notify(8, 0, 0) callback on disconnected mediaplayer
V/MediaPlayer-JNI(25121): release
V/MediaPlayer(25121): setListener
V/MediaPlayer(25121): disconnect
V/MediaPlayer(25121): destructor
V/MediaPlayer(25121): disconnect
I/flutter (25121): _platformCallHandler call audio.onComplete {value: true, playerId: 4e53b7f9-5f74-4001-bce7-bb3e666b6332}

@luanpotter
Copy link
Member

This is on Android, correct? So not the iOS/headphone problem. Other audio sources work? Did you try with different files and options? Is it Local file mode?

@klinki
Copy link
Author

klinki commented Sep 10, 2018

Hello, yes, it is Android. I think I found out what was the problem - playing a remote file with disabled internet connectivity. But I think it should not call onComplete but rather throw some exception or call onError.

@luanpotter
Copy link
Member

Agreed, maybe there is an exception being catch somewhere and then the player thinks it's completed, when in reality it should throw an error. If you'd like to take a look and contribute with a PR, it'll be very appreciated! Otherwise I might take a look at this soon-ish :)

@klinki
Copy link
Author

klinki commented Sep 13, 2018

Sure, I will have a look and try to come with some PR. Probably this or next weekend, I hope.

@amenski
Copy link

amenski commented Mar 8, 2020

Hi guys, did you have success patching this issue? In my case it happens even with working internet. printing " _platformCallHandler call audio.onComplete {value: true, playerId: ef1abaca-5980-4b65-8b3f-0c58a71985b2}" immediately. I don't know if it is the file type(wma), since it is not happening for mp3. I know that it is supported in android. Thank you.

@erickzanardo
Copy link
Member

Closing due inactivity

Gustl22 added a commit to Gustl22/audioplayers that referenced this issue Jul 31, 2022
Gustl22 added a commit to Gustl22/audioplayers that referenced this issue Sep 2, 2022
Gustl22 added a commit to Gustl22/audioplayers that referenced this issue Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants