just_audio icon indicating copy to clipboard operation
just_audio copied to clipboard

Livestream duration is 1 minute on Android

Open lukepighetti opened this issue 3 years ago • 5 comments

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?

lukepighetti avatar Jul 30 '20 01:07 lukepighetti

Reclassifying as a feature request.

ryanheise avatar Jul 30 '20 04:07 ryanheise

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

ryanheise avatar Jul 30 '20 04:07 ryanheise

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.

lukepighetti avatar Jul 30 '20 13:07 lukepighetti

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

ryanheise avatar Jul 30 '20 16:07 ryanheise

This seems to work for me on Android:

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

markst avatar Oct 20 '21 13:10 markst