You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@OverRide
Widget build(BuildContext context) {
return ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.indigoAccent),
shape: MaterialStateProperty.all(
CircleBorder(),
),
),
onPressed: () {
if (_isPlaying) {
_assetsAudioPlayer.pause();
} else {
_assetsAudioPlayer.play();
}
},
child: Icon(
_isPlaying ? Icons.pause : Icons.play_arrow,
size: 32,
color:Colors.orangeAccent,
),
);
}
} I try to play some audio file with mp3. format , some of them can be played some others can not be played. And these errors in console appear. is there anybody to help me for fixing it?
V/MediaPlayer-JNI(23734): native_setup
V/MediaPlayerNative(23734): constructor
V/MediaPlayerNative(23734): setListener
V/MediaPlayer-JNI(23734): reset
V/MediaPlayerNative(23734): reset
V/MediaPlayer(23734): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(23734): cleanDrmObj: mDrmObj=null mDrmSessionId=null
V/MediaPlayer(23734): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(23734): cleanDrmObj: mDrmObj=null mDrmSessionId=null
V/MediaPlayer-JNI(23734): release
V/MediaPlayerNative(23734): setListener
V/MediaPlayerNative(23734): disconnect
V/MediaPlayerNative(23734): destructor
V/MediaPlayerNative(23734): disconnect
W/System.err(23734): com.github.florent37.assets_audio_player.playerimplem.PlayerFinder$NoPlayerFoundException
W/System.err(23734): at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder._findWorkingPlayer(PlayerFinder.kt:70)
W/System.err(23734): at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder._findWorkingPlayer(PlayerFinder.kt:88)
W/System.err(23734): at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder.access$_findWorkingPlayer(PlayerFinder.kt:26)
W/System.err(23734): at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder$_findWorkingPlayer$1.invokeSuspend(Unknown Source:15)
W/System.err(23734): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
W/System.err(23734): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
W/System.err(23734): at android.os.Handler.handleCallback(Handler.java:938)
W/System.err(23734): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(23734): at android.os.Looper.loop(Looper.java:246)
W/System.err(23734): at android.app.ActivityThread.main(ActivityThread.java:8653)
W/System.err(23734): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(23734): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
W/System.err(23734): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
I/flutter (23734):
The text was updated successfully, but these errors were encountered:
class AudioPlayer extends StatefulWidget {
final String audioPath;
const AudioPlayer({Key? key, required this.audioPath}) : super(key: key);
@OverRide
AudioPlayerState createState() => AudioPlayerState();
}
class AudioPlayerState extends State {
final AssetsAudioPlayer _assetsAudioPlayer = AssetsAudioPlayer();
bool _isPlaying = false;
@OverRide
void initState() {
super.initState();
_initAudioPlayer();
}
@OverRide
void dispose() {
_assetsAudioPlayer.dispose();
super.dispose();
}
Future _initAudioPlayer() async {
await _assetsAudioPlayer.open(Audio.file(widget.audioPath), autoStart: false);
_assetsAudioPlayer.isPlaying.listen((isPlaying) {
setState(() {
_isPlaying = isPlaying;
});
});
}
@OverRide
Widget build(BuildContext context) {
return ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.indigoAccent),
shape: MaterialStateProperty.all(
CircleBorder(),
),
),
onPressed: () {
if (_isPlaying) {
_assetsAudioPlayer.pause();
} else {
_assetsAudioPlayer.play();
}
},
child: Icon(
_isPlaying ? Icons.pause : Icons.play_arrow,
size: 32,
color:Colors.orangeAccent,
),
);
}
} I try to play some audio file with mp3. format , some of them can be played some others can not be played. And these errors in console appear. is there anybody to help me for fixing it?
The text was updated successfully, but these errors were encountered: