youtube_player_flutter
youtube_player_flutter copied to clipboard
[BUG] LiveBottomBar - InheritedYoutubePlayer - _LiveBottomBarState - slider.dart: Failed assertion - 'value >= min && value <= max': is not true.
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]
Did you find out how to fix this issue?
No I haven't, any thoughts @sarbagyastha ?
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.
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.
Just checked what youtube does with the slider when it is live video:
- The slider is on the end by default

- You can slide backward with the stream history, as It is shown in the screenshot below, time is -6:41:40

- 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
Any update on this issue I’m only able to hear the sound of the Live video.