florent37 / Flutter-AssetsAudioPlayer

Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications
https://pub.dartlang.org/packages/assets_audio_player
Apache License 2.0
755 stars 360 forks source link

cannot open HLS type etc #528

Open ljx0520 opened 3 years ago

ljx0520 commented 3 years ago

Under PlayerImplemExoPlayer.kt

This part seems to cause an issue. m3u8 cannot play properly on android.

Line 47 to Line 52. When audio type is network and file type is either HLS or Dash, it cannot reach beyond this statement and throw IncompatibleException.

if(configuration.audioType != Player.AUDIO_TYPE_LIVESTREAM && configuration.audioType != Player.AUDIO_TYPE_LIVESTREAM){ if(type == Type.HLS || type == Type.DASH || type == Type.SmoothStreaming) { throw IncompatibleException(configuration.audioType, type) } }

erickcchoi commented 2 years ago

any update???

mt633 commented 1 year ago

I've also stumbled upon this error. That check seems weird to me, but I suppose there might be an option to play non-network based HLS files on other platforms?

Either way, it should probably not check for the same type twice: if(configuration.audioType != Player.AUDIO_TYPE_LIVESTREAM && configuration.audioType != Player.AUDIO_TYPE_LIVESTREAM)

My guess is that the line is supposed to look like this:

if (configuration.audioType != Player.AUDIO_TYPE_LIVESTREAM && configuration.audioType != Player.AUDIO_TYPE_NETWORK) {

Changing it to the above resolves the issue for me at least.

Too bad this project seems to be abandoned. It's a really great library but it has some bugs here and there that need some attention.