Open jibinjayachandran opened 1 year ago
@ryanheise Could you please help me on this issue I'm facing on android ?
I resolved this issue by setting the url as HlsAudioSource and it works fine both in andorid and ios.
await _player.setAudioSource(
HlsAudioSource(Uri.parse(url)));
but in server , it hits too many times.
217.165.13.115 - - [03/Oct/2023:12:12:59 +0000] "GET /api/m3u8?mood=4 HTTP/1.1" 200 10820 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:12:59 +0000] "GET /api/track/relay/225.mp3 HTTP/1.1" 302 2458 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:13:11 +0000] "GET /api/m3u8?mood=4 HTTP/1.1" 200 10820 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:13:12 +0000] "GET /api/track/relay/142.mp3 HTTP/1.1" 302 2474 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:13:12 +0000] "GET /api/m3u8?mood=4 HTTP/1.1" 200 10820 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:13:12 +0000] "GET /api/m3u8?mood=4 HTTP/1.1" 200 10820 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:13:12 +0000] "GET /api/m3u8?mood=4 HTTP/1.1" 200 10820 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:13:13 +0000] "GET /api/m3u8?mood=4 HTTP/1.1" 200 10820 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:13:13 +0000] "GET /api/m3u8?mood=4 HTTP/1.1" 200 10820 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:13:13 +0000] "GET /api/m3u8?mood=4 HTTP/1.1" 200 10820 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
217.165.13.115 - - [03/Oct/2023:12:13:13 +0000] "GET /api/m3u8?mood=4 HTTP/1.1" 200 10820 "-" "just_audio/1.0.0 (Linux;Android 13) ExoPlayerLib/2.18.7"
@ryanheise Could you please suggest me why this is happening and How do I resolve this ?
Thanks for doing some exploration. Yes regarding the behaviour of setUrl
, it can only try to guess whether it should be HLS by looking at the extension. Since your URL doesn't follow that convention of using an extension in the filename, it fails to guess. So if you are in control of the server, another option (besides directly using HlsAudioSource
) is to change the endpoint to something like /api/something.m3u8
.
Regarding the server logs, I think that once you're actually getting it to detect that it's HLS, then the plugin uses the native Android or iOS system to play that stream, and in the above case, that is Android's ExoPlayer making all those calls. Maybe you can test other Android apps with the same URL to see if they hit the server in the same way.
Which API doesn't behave as documented, and how does it misbehave?
AudioPlayer.setUrl('https://api.moodstream.anothercircus.com/api/m3u8?mood=4')
not working in android device and it gives ExoplaybackExceptionjust_audio: ^0.9.35
Minimal reproduction project
To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:
Error messages
Expected behavior The url which I given in the example code works fine in the ios device.the issue is only happening in android device or emulators.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Flutter SDK version
Additional context Add any other context about the problem here.