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] Bad behavior of overriddenDuration #538

Closed
1x3x3x7 opened this issue Jun 7, 2021 · 4 comments
Closed

[BUG] Bad behavior of overriddenDuration #538

1x3x3x7 opened this issue Jun 7, 2021 · 4 comments
Assignees

Comments

@1x3x3x7
Copy link

1x3x3x7 commented Jun 7, 2021

When you set overriddenDuration: Duration(seconds: 30) to BetterPlayerDataSource and this video is 10 seconds it have bad behavior. I think better solution is set max duration to progress bar and loop this video to the end.

@1x3x3x7 1x3x3x7 added the new issue New issue which has not been checked yet label Jun 7, 2021
@jhomlala
Copy link
Owner

jhomlala commented Jun 7, 2021

Please read this: #535 and format your issue according to issue template.

@1x3x3x7
Copy link
Author

1x3x3x7 commented Jun 7, 2021

Sample of code:

class VideoScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Video"),
      ),
      body: VideoWidget(),
    );
  }
}

class VideoWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _VideoWidgetState2();
  }
}

class _VideoWidgetState2 extends State<VideoWidget> {
  final playerConfig = BetterPlayerConfiguration(
      autoPlay: true,
      allowedScreenSleep: false,
      aspectRatio: 1280 / 720,
      controlsConfiguration: BetterPlayerControlsConfiguration(
          showControlsOnInitialize: false,
          enableOverflowMenu: false,
          enableSkips: false));

  @override
  Widget build(BuildContext context) {
    return Center(
        child: BetterPlayer(
            controller: BetterPlayerController(
      playerConfig,
      betterPlayerDataSource: createDataSource(),
    )));
  }

  BetterPlayerDataSource createDataSource() => BetterPlayerDataSource(
      BetterPlayerDataSourceType.network,
      'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4',
      overriddenDuration: Duration(seconds: 30));
}

@1x3x3x7
Copy link
Author

1x3x3x7 commented Jun 7, 2021

Screen.Recording.2021-06-07.at.20.10.55.mov

@jhomlala
Copy link
Owner

Fixed in 0.0.70.

@jhomlala jhomlala removed the new issue New issue which has not been checked yet label Jun 20, 2021
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