CommunityToolkit / Maui

The .NET MAUI Community Toolkit is a community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors to help make your life as a .NET MAUI developer easier
https://learn.microsoft.com/dotnet/communitytoolkit/maui
MIT License
2.09k stars 337 forks source link

Bug fix for MediaElement File Duplication #1868

Closed ne0rrmatrix closed 5 days ago

ne0rrmatrix commented 3 weeks ago

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:

  1. Removal of fullscreen.svg Resource: The static fullscreen.svg image resource was removed, indicating a move away from static images for the fullscreen button.
  2. Introduction of Font Icons for Fullscreen Controls: Replacing the Image with FontIcon elements for fullscreen controls, utilizing glyphs from the "Segoe MDL2 Assets" font for a more flexible and accessible approach.
  3. 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.
  4. 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.
  5. 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.
  6. 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

ne0rrmatrix commented 3 weeks ago

@mhrastegari Thank you for the excellent suggestions. Good catch! PR has been updated as you suggested.

mhrastegari commented 3 weeks ago

Happy to help 🥰 @ne0rrmatrix

briankanelson commented 3 weeks ago

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).

ne0rrmatrix commented 3 weeks ago

@pictos I updated it as requested.