youtube_player_flutter icon indicating copy to clipboard operation
youtube_player_flutter copied to clipboard

[BUG] Value out of range error in YoutubePlayer slider

Open pawankumar-creator opened this issue 1 year ago • 3 comments

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<LiveClassController> {
  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.

pawankumar-creator avatar May 24 '23 06:05 pawankumar-creator

Any update? Am having the same issue.

admincode1 avatar May 28 '23 11:05 admincode1

I'm also having this issue.

faithoflifedev avatar Jun 21 '23 13:06 faithoflifedev

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

birger-ant avatar Feb 27 '24 07:02 birger-ant