Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pawankumar-creator opened this issue May 24, 2023 · 3 comments
Open

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

pawankumar-creator opened this issue May 24, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@pawankumar-creator
Copy link

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 pawankumar-creator added the bug Something isn't working label May 24, 2023
@admincode1
Copy link

Any update? Am having the same issue.

@faithoflifedev
Copy link

I'm also having this issue.

@birger-ant
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants
@faithoflifedev @sarbagyastha @admincode1 @pawankumar-creator @birger-ant and others