Skip to content

Add race playback controls with UI buttons#74

Merged
IAmTomShaw merged 8 commits intoIAmTomShaw:mainfrom
viralcodex:race_controls_ui
Dec 18, 2025
Merged

Add race playback controls with UI buttons#74
IAmTomShaw merged 8 commits intoIAmTomShaw:mainfrom
viralcodex:race_controls_ui

Conversation

@viralcodex
Copy link
Copy Markdown
Contributor

Introduced RaceControlsComponent to provide playback controls (play/pause, rewind, forward, speed adjustment) with new button images and integrated it into the F1RaceReplayWindow.

Buttons: Play/Pause, Rewind, Forward, and speed control buttons (2x+ and 2x-)

I have also separated the tooltip from RaceProgressBar to make sure the tooltips are coming over all the other components instead of getting covered by other components.

viralcodex and others added 3 commits December 18, 2025 15:34
Introduced RaceControlsComponent to provide playback controls (play/pause, rewind, forward, speed adjustment) with new button images and integrated it into the F1RaceReplayWindow. Updated event handling and drawing logic to support the new controls and improved UI responsiveness to window resizing.
Implemented visual flash feedback for race control buttons when triggered by keyboard shortcuts in both qualifying and race replay windows. Updated RaceControlsComponent to support flash animations and refactored drawing logic to show flash and hover effects. Integrated on_update calls to animate flashes and ensured all relevant keyboard events trigger the appropriate button flash.
@viralcodex
Copy link
Copy Markdown
Contributor Author

Screen.Recording.2025-12-18.at.4.40.18.PM.mp4

Hi @IAmTomShaw,
I have implemented these race control buttons to enhance the replay experience, this feature along with the progress bar component makes it a full video playback will make it full fledged watch experience.

Please let me know if any other enhancements are needed or I missed something. I have attached the video for demo purpose 😄

@IAmTomShaw
Copy link
Copy Markdown
Owner

Great work! Are you able to change the << and >> button icons to reflect "previous frame" and "next frame" icons? I think the ones you've used give the impression that the video will be fast forwarded or rewinded.

For the playback speed toggle, can you change the "2x-" and "2x+" to just "-" and "+"? I think it looks cleaner :)

@viralcodex
Copy link
Copy Markdown
Contributor Author

Great work! Are you able to change the << and >> button icons to reflect "previous frame" and "next frame" icons? I think the ones you've used give the impression that the video will be fast forwarded or rewinded.

For the playback speed toggle, can you change the "2x-" and "2x+" to just "-" and "+"? I think it looks cleaner :)

Sure, for speed since it was doubling and halving at each step, thats why I thought user should know the change is +/- 2x.

@viralcodex
Copy link
Copy Markdown
Contributor Author

@IAmTomShaw , the icons for going back and ahead, will the one's that are like a rounded arrow in a direction work? Like we see in video player online to seek 10 seconds ahead and behind?

@IAmTomShaw
Copy link
Copy Markdown
Owner

Okay, let's keep the arrow icons the same and we'll see if any feedback from the community suggests if they need changing. As soon as the + and - are changed I'll be able to merge :)

Replaces the existing speed+.png and speed-.png images with updated versions and removes the obsolete speed.png file from the controls image set.
@viralcodex
Copy link
Copy Markdown
Contributor Author

@IAmTomShaw, I have made the changes, have a look and can be merged. Regarding DRS zones, please if you can have a look there as well and get it merged, it will be great 😄 .

@IAmTomShaw
Copy link
Copy Markdown
Owner

Screenshot 2025-12-18 at 15 06 35

Ah just noticed, I get this error when I try to use the previous and next frame buttons on the qualifying interface

@viralcodex
Copy link
Copy Markdown
Contributor Author

Screenshot 2025-12-18 at 15 06 35 Ah just noticed, I get this error when I try to use the previous and next frame buttons on the qualifying interface

strange, let me check what is the issue 😮

@IAmTomShaw
Copy link
Copy Markdown
Owner

IAmTomShaw commented Dec 18, 2025 via email

Prevents interaction with race controls and most keyboard shortcuts when the lap is complete, except for restart and comparison toggle. Also auto-pauses playback at the end of the lap to avoid errors.
Updated the rewind and forward controls in RaceControlsComponent to cast frame_index to int, ensuring frame navigation uses integer indices and preventing potential float-related issues.
@viralcodex
Copy link
Copy Markdown
Contributor Author

viralcodex commented Dec 18, 2025

@IAmTomShaw , should work now, also updated the code to disable the race controls when finished the lap and they will work only when restarted. Issue is that in qualifying, the self.frame_index is int but in race replay it is float, so I coded based on race_replay but it failed due to type mismatch in both scenarios

@IAmTomShaw IAmTomShaw merged commit b602ce0 into IAmTomShaw:main Dec 18, 2025
@IAmTomShaw
Copy link
Copy Markdown
Owner

Merged :)

@viralcodex
Copy link
Copy Markdown
Contributor Author

Thanks and have a nice day 😄

@viralcodex viralcodex deleted the race_controls_ui branch December 19, 2025 03:44
bsreeram08 pushed a commit to bsreeram08/f1-race-replay that referenced this pull request Dec 19, 2025
abhsingh487 pushed a commit to abhsingh487/f1-race-replay-1 that referenced this pull request Apr 6, 2026
Add race playback controls with UI buttons
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