Closed pro100svitlo closed 4 years ago
Can you try to implement that ? I do not have much time for now to implement this
I can try to take a look, but I have 0 experience with library development :)
I started on #224
for now I have
enum AssetsAudioPlayerErrorType {
Network,
Player
}
Player is like unknownError
It's not finished yet
it's available, you can try the 2.0.5
look at readme :
_player.onErrorDo = (handler){
handler.player.stop();
};
and in the handler you have an error
that has an attribut type
that can be Network
:)
i hav tried the new update. its awesome. i tried to use this update for my issue #187 . it solve the problem mostly. but choosing action to pause when internet connection goes off and when net comes online choosing play action still doesn't play the music from that point. as new handler give all the necessary thing to reopen the play from exact same point but reopening it in that reason will reset everything and progess bar shown in ui will goes to 0 and than suddenly moves to that point. idk if it can be fixed or not.
It works as expected when you open
audio, it plays for some time, and then network gone 👍
But if I will try open network audio when there is no connection, it still froze the app 😢
Tested on example app.
@pro100svitlo for that we can check in flutter only. There are many package which help to check network connection. If network is not available we can stop the user from calling that method and show approriate message from flutter only.
@Timus23 Yes, you are right.
But there still might be cases, when package
will return you that network fine, but in fact, there are no transmission. In those cases that package will be useless.
yea there are some cases. when i tried to open network songs without internet. it simply freezes the app and when i enable the network. it start playing music automatically and unfreezes the app. In that case the error handling didn't work.
I still think that this handling should be done internally, cos there pretty much cases:
I all those cases if the audio is not cached and needs a network - the app will be frozen
Right now if I turn on example app without internet (flight mode) and click
Online
track - it freezes the app, which is not nice. Also when it happens, the player throwsPlatformException
, and it's not usable after it...So, here I have a few propositions:
noNetwork
/internalError
/unknownError
, etc.open
called, otherwise it's hard to show user why click didn't make any impact