youtube_player_flutter icon indicating copy to clipboard operation
youtube_player_flutter copied to clipboard

[BUG] LiveBottomBar - InheritedYoutubePlayer - _LiveBottomBarState - slider.dart: Failed assertion - 'value >= min && value <= max': is not true.

Open Ashkan-Sarlak opened this issue 2 years ago • 6 comments

Describe the bug When playing live Youtube stream, I can see the video, but plugin constantly throws this exception:

======== Exception caught by widgets library ======================================================= The following assertion was thrown building LiveBottomBar(dirty, dependencies: [InheritedYoutubePlayer], state: _LiveBottomBarState#1c04f): 'package:flutter/src/material/slider.dart': Failed assertion: line 147 pos 15: 'value >= min && value <= max': is not true.

To Reproduce This is the relevant YoutubePlayer parts of code:

YoutubePlayerController _controller = YoutubePlayerController( initialVideoId: YoutubePlayer.convertUrlToId(store.youtubeBroadcastLink!) ?? '', flags: const YoutubePlayerFlags( isLive: true, ), );

return ClipRRect( borderRadius: BorderRadius.circular(5), child: AspectRatio( aspectRatio: 345 / 180, child: YoutubePlayer(controller: _controller), ), );

Expected behavior Plugin should not throw this exception. It floods the log panel and I can't see any other of my app's logs.

Technical Details:

  • Device: iPhone SE (2nd gen)
  • OS: [iOS15.5]

Ashkan-Sarlak avatar Jul 06 '22 14:07 Ashkan-Sarlak

Did you find out how to fix this issue?

phatnguyen1006 avatar Oct 28 '22 03:10 phatnguyen1006

No I haven't, any thoughts @sarbagyastha ?

Ashkan-Sarlak avatar Oct 29 '22 16:10 Ashkan-Sarlak

Hi @Ashkan-Sarlak ,

Settings isLive: false fixed the issue but the Slider is randomly going back and forth

I would like to ask a question related to this LiveBottomBar, do we need the seekbar (Slider) in live videos ? It looks like we don't need the slider and calculating its position when the video is live. just showing any placeholder container instead of the slider would fix this issue.

iballan avatar Dec 19 '22 10:12 iballan

Hi @iballan, I can do without the slider for my particular use case, but other apps might need it. If setting isLive: false (though this does not make sense semantically; wouldn't this affect any other part of the functionality?) silences the logs, having an option to remove the slider is not a bad solution.

Ashkan-Sarlak avatar Dec 23 '22 16:12 Ashkan-Sarlak

Just checked what youtube does with the slider when it is live video:

  • The slider is on the end by default
slider
  • You can slide backward with the stream history, as It is shown in the screenshot below, time is -6:41:40
slider 2
  • When you slide to the end, the time goes to 0:00, and starts stream again

I am not sure whether this what the author was trying to do there, anyway it is crashing now. As a workaround, setting isLive:false just worked fine for me.

If we are not able to do it like youtube, having fixed placeholder or disabled slider would fix the issue.

@sarbagyastha may help us here

iballan avatar Dec 23 '22 19:12 iballan

Any update on this issue I’m only able to hear the sound of the Live video.

AzaanForcebolt avatar Sep 06 '23 10:09 AzaanForcebolt