Comments (16)
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.
Hi, could you attach the code causing this error?
from flutter_exoplayer.
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.
you can enable log with this line: AudioPlayer.logEnabled = true;
from flutter_exoplayer.
also what version are you using?
from flutter_exoplayer.
Tried it and the log showed nothing, I'm using lastest version
from flutter_exoplayer.
Sometimes the player work with no error, but sometimes it errors
from flutter_exoplayer.
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.
Wait, I'm not sure about it.
from flutter_exoplayer.
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.
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.
Good luck! Hope you fix it asap.
from flutter_exoplayer.
Any news?
from flutter_exoplayer.
Hi, so you dont have time to fix it? I need your plugin to continue my project tbh
from flutter_exoplayer.
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.
Thanks! I really appreciate your help!
from flutter_exoplayer.
Related Issues (20)
- Support custom HTTP headers. HOT 1
- notification title
- Supporting downloads
- Notification with a single audio HOT 1
- Releasing the player HOT 3
- How get onAudioPositionChanged after mounted
- youtube live video, quality, speedo meter support HOT 1
- Build failed, could not find core.jar (androidx.core:core:1.1.0). HOT 1
- Support URL Streaming
- Unable to trap Errors Contitions
- Android 11 issue
- Crashes after close playing app in foreground mode
- OnPlayerCompletion unavailable
- how to play youtube video
- error on building with exoplayer video and audio in 1 project HOT 2
- retrieve meta data from live audio stream
- Misleading flutter package
- Feature: Allow playing of DRM content
- In iOS Can't Play
- No implementation for iOS available
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_exoplayer.