Skip to content

Conversation

@Berrysoft
Copy link
Member

  • looped
  • playback_rate

@Berrysoft Berrysoft self-assigned this Dec 6, 2025
@Berrysoft Berrysoft changed the title feat(windows): more methods for Media feat(media): more methods for Media Dec 6, 2025
@Berrysoft Berrysoft marked this pull request as ready for review December 7, 2025 11:46
@Berrysoft Berrysoft requested a review from Copilot December 7, 2025 11:46
Copy link
Contributor

Copilot AI left a 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(), and set_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.

@Berrysoft Berrysoft merged commit 7570c6b into master Dec 7, 2025
16 checks passed
@Berrysoft Berrysoft deleted the dev/media-more branch December 7, 2025 12:21
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