Skip to content

Improve Video Playback UI & Maintainability #457

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

Merged
merged 8 commits into from
May 19, 2025
Merged

Conversation

NBA2K1
Copy link
Contributor

@NBA2K1 NBA2K1 commented May 18, 2025

This PR introduces several improvements to the video playback experience and code maintainability:

  • Code Quality Enhancements:

    • Reduced duplication in anime_player_view.dart by introducing a helper method for _mobileBottomButtonBar() and _desktopBottomButtonBar().
    • Extracted CustomMaterialPlayOrPauseButton class from mobile.dart and desktop.dart into a separate file to eliminate redundant implementations.
  • Bug Fixes:

    • Fixed an assertion error in custom_seekbar.dart when skipping beyond the video duration, ensuring the slider value remains within valid bounds.
    • Addressed a UI bug in desktop.dart where playback time exceeded the maximum duration when skipping near the end of a video.
  • Feature Additions:

    • Implemented a dropdown menu in anime_player_view.dart for adjusting video playback speed, so the user doesn't have to cycle through all speed-options.
  • Infrastructure Updates:

    • Updated release.yml to fetch the latest appimagetool, instead of the obsolete version.

NBA2K1 added 8 commits May 17, 2025 04:56
Prevent an AssertionError in the Slider widget when the skip duration
button causes the value to exceed the video's maximum duration.
Clamp the Slider's value to the range [0, max]
using `clamp(0.0, maxValue).toDouble()` to ensure it stays within bounds.

Exception example:
```
Exception has occurred.
_AssertionError ('package:flutter/src/material/slider.dart': Failed assertion: line 199 pos 10: 'value >= min && value <= max': Value 1410000.0 is not between minimum 0.0 and maximum 1409533.0)
```
Fix playback time display exceeding max duration when skipping near video end
Extract `CustomMaterialPlayOrPauseButton` class from *mobile.dart* and `CustomMaterialDesktopPlayOrPauseButton` class from *desktop.dart* into *play_or_pause_button.dart* to eliminate code duplication and improve maintainability.
@kodjodevf kodjodevf merged commit fc5776a into kodjodevf:main May 19, 2025
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

Successfully merging this pull request may close these issues.

2 participants