-
Notifications
You must be signed in to change notification settings - Fork 6
feat(media): more methods for Media #96
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
Conversation
Berrysoft
commented
Dec 6, 2025
- looped
- playback_rate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds loop control and playback rate adjustment methods to the Media widget. These features enable media to automatically restart when playback completes and allow users to control playback speed.
- Adds
is_looped(),set_looped(),playback_rate(), andset_playback_rate()methods to the Media API - Implements these methods across all platform backends (WinUI, Win32, Qt, GTK, AppKit) and the stub implementation
- Updates the media example to demonstrate the new features with UI controls (ComboBox for rate selection, CheckBox for looping)
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| winio/src/widgets/media.rs | Adds new method signatures to the Media API for loop and playback rate control |
| winio/src/stub/ui/media.rs | Implements stub versions of the new methods |
| winio/examples/subviews/media.rs | Adds UI controls and handlers for loop and playback rate features |
| winio-ui-winui/src/ui/media.rs | Implements loop and playback rate methods using WinUI MediaPlayer APIs, adds SetAutoPlay(false) |
| winio-ui-win32/src/ui/media.rs | Implements loop and playback rate methods using Media Foundation APIs, adds SetAutoPlay(false), caches rate for restoration after play |
| winio-ui-qt/src/ui/media.rs | Implements loop and playback rate methods using Qt QMediaPlayer APIs |
| winio-ui-qt/src/ui/media.hpp | Adds m_loops member to track loop state for Qt 5, adds loops/setLoops methods |
| winio-ui-qt/src/ui/media.cpp | Implements manual looping for Qt 5 by handling EndOfMedia status and restarting playback |
| winio-ui-gtk/src/ui/media.rs | Implements loop methods, returns NotSupported error for playback_rate (not supported by GTK MediaFile) |
| winio-ui-gtk/src/ui/accent.rs | Updates error type from NoColorTheme to NotSupported |
| winio-ui-gtk/src/lib.rs | Adds NotSupported error variant |
| winio-ui-app-kit/src/ui/media.rs | Implements loop and playback rate methods, adds automatic loop handling via NSNotification, adds auto-restart logic when playing from end |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.