Maui
Maui copied to clipboard
Bug fix for MediaElement File Duplication
Bug fix
Sample
https://github.com/CommunityToolkit/Maui/assets/4167863/1f481dc4-5f6e-40d3-aefe-3595cfce58a1
Description of Change
The most significant changes to the MauiMediaElement
involve modernizing the fullscreen controls by transitioning from using static SVG images to adopting FontIcon
elements for better flexibility and visual consistency. This shift enhances the user interface and interaction model for entering and exiting fullscreen mode. The key changes include:
-
Removal of fullscreen.svg Resource: The static
fullscreen.svg
image resource was removed, indicating a move away from static images for the fullscreen button. -
Introduction of Font Icons for Fullscreen Controls: Replacing the
Image
withFontIcon
elements for fullscreen controls, utilizing glyphs from the "Segoe MDL2 Assets" font for a more flexible and accessible approach. - Adjustments to Fullscreen Button Logic: The logic for toggling between the fullscreen and exit fullscreen buttons was refined, including the dynamic addition and removal of buttons and event handlers based on the fullscreen state.
- UI and Styling Adjustments: Several UI and styling adjustments were made to improve the appearance and positioning of the fullscreen controls, such as setting the buttons' background to transparent and adjusting their size and margin.
- Removal of Static Image Source for Fullscreen Button: The static image source for the fullscreen button was removed, aligning with the shift towards a font icon-based approach for controls.
- Event Handling Adjustments: Minor adjustments were made to event handling, particularly in managing the visibility of the button container in response to pointer movements, ensuring intuitive user interactions.
These changes collectively enhance the MauiMediaElement
by making the fullscreen controls more adaptable, visually consistent, and user-friendly.
Linked Issues
- Fixes #1862
PR Checklist
- [x] Has a linked Issue, and the Issue has been
approved
(bug) orChampioned
(feature/proposal) - [ ] Has tests (if omitted, state reason in description)
- [ ] Has samples (if omitted, state reason in description)
- [x] Rebased on top of
main
at time of PR - [x] Changes adhere to coding standard
- [ ] Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls
Additional information
Fixes an issue where if you create a visual studio project and add a second project to it and then add media element to both projects will result in a file duplication error when attempting to build the project. This bug is fixed by not using a file image source and switching to using a FontIcon
.
@mhrastegari Thank you for the excellent suggestions. Good catch! PR has been updated as you suggested.
Happy to help 🥰 @ne0rrmatrix
I have downloaded the nuget and tested it against my project and both issues are resolved (Exiting full screen works ok, and there is no duplicate file error).
@pictos I updated it as requested.