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] <title> isLive: true not working #1014

Open
1 task done
whateverfast opened this issue Oct 19, 2024 · 0 comments
Open
1 task done

[BUG] <title> isLive: true not working #1014

whateverfast opened this issue Oct 19, 2024 · 0 comments
Assignees

Comments

@whateverfast
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Package

youtube_player_iframe (Default)

What happened?

When I select isLive: true, it produces the following exception. This exception makes the player not work properly. This exception is not raised when isLive: false, even if the youtube is live, however the timeline goes out of the frame of the player.

======== Exception caught by widgets library =======================================================
The following assertion was thrown building LiveBottomBar(dirty, dependencies: [InheritedYoutubePlayer], state: _LiveBottomBarState#eb07f):
Value 1.1280666666666668 is not between minimum 0.0 and maximum 1.0
'package:flutter/src/material/slider.dart':
Failed assertion: line 194 pos 15: 'value >= min && value <= max'

What is the expected behaviour?

It should not cause the exception.

How to reproduce?

just run this code:

`import 'package:flutter/material.dart';
import 'package:youtube_player_flutter/youtube_player_flutter.dart';

class MyYoutubePlayer extends StatefulWidget {
@OverRide
_YoutubePlayerState createState() => _YoutubePlayerState();
}

class _YoutubePlayerState extends State {
String _videoId = "z7SiAaN4ogw";
YoutubePlayerController? _controller;

@OverRide
void initState() {
super.initState();
_controller = YoutubePlayerController(
initialVideoId: _videoId!,
flags: YoutubePlayerFlags(
autoPlay: false,
mute: false,
enableCaption: true,
disableDragSeek: true,
loop: false,
forceHD: true,
controlsVisibleAtStart: true,
hideControls: false,
hideThumbnail: false,
isLive: true,
startAt: 0,
),
);
_controller?.setVolume(100); // sets volume to maximum
}

@OverRide
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: Container(
//color: Colors.green,
child: Center(
child: YoutubePlayer(
controller: _controller!,
showVideoProgressIndicator: true,
onReady: () {
print('Player is ready.');
},
),
)));
}

@OverRide
void dispose() {
_controller?.dispose();
super.dispose();
}
}

//For Testing
void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
home: MyYoutubePlayer(),
);
}
}
`

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.24.0, on macOS 14.6.1 23G93 darwin-arm64, locale en-VN)
    • Flutter version 3.24.0 on channel stable at /Users/emanuelsantos/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 80c2e84975 (3 months ago), 2024-07-30 23:06:49 +0700
    • Engine revision b8800d88be
    • Dart version 3.5.0
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/emanuelsantos/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] Connected device (4 available)
    • iPhone 15 Pro (mobile)          • F61EB96C-DEEF-4168-9BBC-B11E3B2D44B5 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 129.0.6668.101

[✓] Network resources
    • All expected network resources are available.

• No issues found!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants