GithubHelp home page GithubHelp logo

Comments (16)

ArvinCS avatar ArvinCS commented on August 18, 2024 1

I'm trying to fix the issue, but I'm not sure i can fix it because it doesn't show any error log since i upgraded my flutter to lastest. It makes me hard to find the bug. But i will do my best :)

from flutter_exoplayer.

danielR2001 avatar danielR2001 commented on August 18, 2024

Hi, could you attach the code causing this error?

from flutter_exoplayer.

ArvinCS avatar ArvinCS commented on August 18, 2024

void _play() async { await widget.music.getAudioURL().then( (String url) { AudioNotification audioNotif = AudioNotification( smallIconFileName: "ic_launcher", title: widget.music.title, subTitle: "by ${widget.music.artist.toString()}", largeIconUrl: widget.music.thumbnail, isLocal: widget.music.isOffline(), notificationDefaultActions: NotificationDefaultActions.ALL, ); debugPrint("player: ${getMPlayer().toString()}"); debugPrint("notif: ${audioNotif.toString()}"); debugPrint("url: ${url.toString()}"); getMPlayer().play(url.toString(), respectAudioFocus: true, playerMode: PlayerMode.FOREGROUND, audioNotification: audioNotif, repeatMode: repeat, position: Duration(milliseconds: 0)); setCurrentMusic(widget.music); } ); setState(() => _playerState = PlayerState.PLAYING); }
Sorry, there was no log about my code that causing that error, only code from yours.
But maybe this can help you :D

from flutter_exoplayer.

danielR2001 avatar danielR2001 commented on August 18, 2024

you can enable log with this line: AudioPlayer.logEnabled = true;

from flutter_exoplayer.

danielR2001 avatar danielR2001 commented on August 18, 2024

also what version are you using?

from flutter_exoplayer.

ArvinCS avatar ArvinCS commented on August 18, 2024

Tried it and the log showed nothing, I'm using lastest version

from flutter_exoplayer.

ArvinCS avatar ArvinCS commented on August 18, 2024

Sometimes the player work with no error, but sometimes it errors

from flutter_exoplayer.

ArvinCS avatar ArvinCS commented on August 18, 2024

I found what causing that error, it's onAudioSessionIdChange event.
Everytime i listen to that stream, it always crashed when i wanna play a music.
Good luck!

from flutter_exoplayer.

ArvinCS avatar ArvinCS commented on August 18, 2024

Wait, I'm not sure about it.

from flutter_exoplayer.

ArvinCS avatar ArvinCS commented on August 18, 2024

E/AndroidRuntime(20423): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String danielr2001.audioplayer.models.AudioObject.getUrl()' on a null object reference
E/AndroidRuntime(20423): at danielr2001.audioplayer.audioplayers.ForegroundAudioPlayer.initExoPlayer(ForegroundAudioPlayer.java:215)
E/AndroidRuntime(20423): at danielr2001.audioplayer.audioplayers.ForegroundAudioPlayer.play(ForegroundAudioPlayer.java:238)
E/AndroidRuntime(20423): at danielr2001.audioplayer.AudioPlayerPlugin$1.onServiceConnected(AudioPlayerPlugin.java:75)
E/AndroidRuntime(20423): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1652)
E/AndroidRuntime(20423): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1681)
E/AndroidRuntime(20423): at android.os.Handler.handleCallback(Handler.java:790)
E/AndroidRuntime(20423): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(20423): at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime(20423): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/AndroidRuntime(20423): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(20423): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/AndroidRuntime(20423): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

from flutter_exoplayer.

danielR2001 avatar danielR2001 commented on August 18, 2024

As I can see from the logs the player crushes because the JAVA AudioObject is not being created properly for some reason, I will look at it in the evening or tomorrow. Thanks for pointing out the bug.

from flutter_exoplayer.

ArvinCS avatar ArvinCS commented on August 18, 2024

Good luck! Hope you fix it asap.

from flutter_exoplayer.

ArvinCS avatar ArvinCS commented on August 18, 2024

Any news?

from flutter_exoplayer.

ArvinCS avatar ArvinCS commented on August 18, 2024

Hi, so you dont have time to fix it? I need your plugin to continue my project tbh

from flutter_exoplayer.

danielR2001 avatar danielR2001 commented on August 18, 2024

Sorry, I have a very busy schedule in the last past weeks. If you know JAVA you are more than welcome to try and fix the issue.

from flutter_exoplayer.

danielR2001 avatar danielR2001 commented on August 18, 2024

Thanks! I really appreciate your help!

from flutter_exoplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.