-
Notifications
You must be signed in to change notification settings - Fork 404
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
Update MediaElement Transport Controls for Windows #2329
Open
ne0rrmatrix
wants to merge
9
commits into
CommunityToolkit:main
Choose a base branch
from
ne0rrmatrix:UpdateWindowsControls
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update MediaElement Transport Controls for Windows #2329
ne0rrmatrix
wants to merge
9
commits into
CommunityToolkit:main
from
ne0rrmatrix:UpdateWindowsControls
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduced a new embedded resource, `ResourceDictionary.windows.xaml`, in the `CommunityToolkit.Maui.MediaElement.csproj` project file. Updated `MauiMediaElement.windows.cs`: - Imported new namespaces. - Added `CustomTransportControls` field and methods for loading resource dictionary and applying custom styles. - Updated constructor to load resource dictionary and set custom transport controls. - Added `LoadResourceDictionary`, `ApplyCustomStyle`, and `SetTransportControls` methods. - Updated `Dispose` method to handle custom transport controls. - Removed `OnMediaPlayerElementPointerMoved` method and related code. - Updated `OnFullScreenButtonClick` method to remove fullscreen button references. Updated `MediaManager.windows.cs`: - Disabled `SystemMediaTransportControls` in `CreatePlatformView`. Added `CustomTransportControls` class in `CommunityToolkit.Maui.Primitives`: - Imported necessary namespaces. - Defined `FullScreenButton` property. - Implemented `OnTemplateLoaded` event. - Overrode `OnApplyTemplate` method to add full-screen button. - Added `FullScreenButton_Click` event handler. - Introduced `isFullScreen` field to track full-screen state.
Moved RightSeparator before PlaybackRateButton in ResourceDictionary.windows.xaml. Added RightSeparator with Height='0', Width='0', and Margin='0,0'. Reordered properties of PlaybackRateButton without changing values. Removed original RightSeparator after PlaybackRateButton.
Re-added various properties and elements to styles and templates in `ResourceDictionary.windows.xaml` to ensure consistent UI appearance and behavior. Added new buttons like `ZoomButton` and `CastButton` to the media controls command bar. Enhanced `customTransportcontrols` and `CommandBarStyle` with additional properties.
Removed the `UseLayoutRounding` property and adjusted the `Margin` property from `0,0,0,20` to `0,0,0,10`. Added `VerticalContentAlignment` set to `Center` and `VerticalAlignment` set to `Bottom`. Introduced `CornerRadius` of `8,8,8,8` to the `Grid` element in the `ResourceDictionary.windows.xaml` file.
- Cleaned up `using` directives by removing redundant `using CommunityToolkit.Maui.Core;` and reordering the remaining directives. - Changed `CustomTransportControls` class from public sealed to sealed partial. - Removed XML documentation comments for `CustomTransportControls` class and its members. - Changed `FullScreenButton` property from nullable `AppBarButton` with a private setter to non-nullable `AppBarButton` initialized with a new instance. - Removed null check for `FullScreenButton` in `FullScreenButton_Click` method as `FullScreenButton` is no longer nullable.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Update MediaElement Transport Controls for Windows. Adds Support for Full Screen button in the controls. Controls are updated to have play, pause, Fast Forward, Next, Previous, Inline Volume Controls, Repeat button, Cast Button and an Aspect button.
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information
This updates the windows controls to support all the Media Buttons you could want.