sarbagyastha / youtube_player_flutter

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.
https://youtube.sarbagyastha.com.np
BSD 3-Clause "New" or "Revised" License
690 stars 765 forks source link

[BUG] Value out of range error in YoutubePlayer slider #827

Open pawankumar-creator opened 1 year ago

pawankumar-creator commented 1 year ago

Description I encountered an issue while using the youtube_player_flutter package (version 8.1.2 or 8.0.0) where I received an error message indicating that a value was outside the acceptable range for the slider component.

Error Message:

  1. Value out of range error:

════════ Exception caught by widgets library ═══════════════════════════════════ Value 1.0003695626877442 is not between minimum 0.0 and maximum 1.0 'package:flutter/src/material/slider.dart': package:flutter/…/material/slider.dart:1 Failed assertion: line 163 pos 15: 'value >= min && value <= max'

  1. int assertionStart, int assertionEnd, Object? message error:

@pragma("vm:external-name", "AssertionError_throwNew") external static _doThrowNew( int assertionStart, int assertionEnd, Object? message);

Expected behavior When playing a live YouTube video in the app using the YoutubePlayer widget, the slider component should accept a value within the valid range (0.0 to 1.0) without throwing the value out of range error. Additionally, the int assertionStart, int assertionEnd, Object? message error should not occur.

Screenshots

error in youtube_player_flutter package error in youtube_player_flutter package
Additional Information: I am using the youtube_player_flutter package version 8.1.2 (or 8.0.0) and Flutter SDK version 3.10.1. This issue occurs consistently and prevents the correct usage of the slider component in the YoutubePlayer widget when playing live YouTube videos. Sometimes it's also throw **Use Case** ``` class LiveClassView extends GetView { final LiveClassController liveClassController = Get.put(LiveClassController()); final YoutubePlayerController _controller = YoutubePlayerController( initialVideoId: Get.arguments[1], flags: YoutubePlayerFlags( autoPlay: false, hideThumbnail: true, useHybridComposition: true, isLive: true, disableDragSeek: false, hideControls: false, ), ); @override Widget build(BuildContext context) { return Scaffold( body: YoutubePlayer( controller: _controller, aspectRatio: 16 / 9, showVideoProgressIndicator: true, ), ); } }``` Thank you for your attention to this issue. Please let me know if any further information is required.
admincode1 commented 1 year ago

Any update? Am having the same issue.

faithoflifedev commented 1 year ago

I'm also having this issue.

birger-ant commented 5 months ago

Just upgraded to 9.0 and I also get the issue. Any fixes?