ryanheise / just_audio

Audio Player
1.03k stars 655 forks source link

Livestream duration is 1 minute on Android #135

Open lukepighetti opened 4 years ago

lukepighetti commented 4 years ago

On iOS, when you add a livestream url, the duration is null. But on Android it's 1 minute. How do we detect if the current url is a livestream or not?

ryanheise commented 4 years ago

Reclassifying as a feature request.

ryanheise commented 4 years ago

There is currently no feature to test whether the current item is a live stream.

lukepighetti commented 4 years ago

We will include this as metadata along with the URL when setting up a track. Feel free to close if you feel this is reasonable.

ryanheise commented 4 years ago

I'll keep this open for now since I think it would be a useful API to add some time down the line.

markst commented 2 years ago

This seems to work for me on Android:

StreamBuilder<Duration>(
    stream: _player.durationStream,
    builder: (context, snapshot) {
      final isLive = (snapshot?.data ?? Duration.zero) == Duration.zero;