ryanheise / just_audio

Audio Player
1.03k stars 650 forks source link

Android Auto - live stream display duration error #1191

Open ivanoe83 opened 7 months ago

ivanoe83 commented 7 months ago

Which API doesn't behave as documented, and how does it misbehave? Not sure about "JustAudioBackground MediaItem class - duration"

We have a live streaming radios app. When we connect the phone to Android Auto and launch play, in addition to displaying the metadata of cover, title and author, despite not being entered the duration indicator in seconds is displayed. The main problem is that the seconds appear and disappear making the metadata "jump around"

Minimal reproduction project "The example"

To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:

  1. Connect to Android Auto
  2. Play

Error messages

 No error messages shown

Expected behavior We would like the duration not to be displayed, but I haven't found how to do

Screenshots Attached a video of the problem

https://github.com/ryanheise/just_audio/assets/86149943/9a03d243-45d7-4df8-b1c2-5df9ff708620

Desktop (please complete the following information):

Smartphone (please complete the following information):

Flutter SDK version

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.0, on macOS 13.4 22F66 darwin-arm64 (Rosetta),
    locale it-IT)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

Additional context Sorry if I have omitted anything, but this is my first "issue"

itseramin commented 1 month ago

I'm trying to play back audio live streams too, I already wrote the platform specific code to establish a connection to a SRT server to retrieve the MP3 audio frames as byte arrays. What I need guidance in is to feed the bytes to an AudioSource. Any chance you can explain to me how did you manage to playback the raw audio bytes?