Skip to content

refactor(mediaplayer)!: Reparent MediaPlayerPresenter to FrameworkElement - #23807

Merged
Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260717/reparent-mediaplayerpresenter-to-fe
Jul 22, 2026
Merged

Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260717/reparent-mediaplayerpresenter-to-fe

Conversation

@Xiaoy312

Copy link
Copy Markdown
Contributor

GitHub Issue: Part of #8339

PR Type:

💬 Other — Breaking change (base-class realignment for WinUI parity; targets feature/breakingchanges)

What changed? 🚀

MediaPlayerPresenter now derives directly from FrameworkElement (matching WinUI) instead of Border, removing the extra Border level and its leaked Child/BorderBrush/BorderThickness/CornerRadius/Padding/BackgroundSizing/ChildTransitions surface. The video surface is hosted via an internal Child slot (AddChild/RemoveChild + ArrangeOverride); the 6 platform media extensions reach it unchanged through InternalsVisibleTo. MediaPlayerElement now paints its black background on the template LayoutRoot (a Panel) so letterbox bars stay black.

Validation (Skia Desktop):

  • Compile: SamplesApp.Skia.Generic (net10.0) — ✅ 0 errors, including the Win32 and X11 media extensions building against the internal Child via IVT.
  • Runtime: Given_MediaPlayerPresenter 1/1 (structural — base is FrameworkElement, not Border).

⚠️ Needs per-head validation before relying on this: the load-bearing assumption is that AddChild on a bare FrameworkElement (not a Panel/Border) composites and renders the child on a media-capable head — media playback runtime tests are extension/codec-gated and largely [Ignore]d, so this and the black-letterbox visual weren't exercised here. The 4 non-desktop extensions (MacOS/Android/AppleUIKit/Browser) are unchanged but weren't compiled on this machine.

PR Checklist ✅

  • 🧪 Added Runtime test (Given_MediaPlayerPresenter, structural)
  • 📚 Docs updated (migrating-to-uno-7.md → "Type-hierarchy changes")
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests

Breaking change / migration: the Border-only surface is gone from MediaPlayerPresenter and is Border is no longer true for a presenter; playback and Stretch are unchanged. Migration note included in migrating-to-uno-7.md.

@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Jul 17, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222891 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 97

Details
  • skia-linux-screenshots: 67 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BitmapIcon_Foreground.png
    • Buttons.png
    • ElementLevelTheme.png-dark
    • Image_Margin_Large.png-dark
    • Buttons.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • DisplayInformation.png-dark
    • DataTransferManager.png
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • Gamepad_CurrentReading.png-dark
    • Examples.png-dark
    • Examples.png
    • DynamicFont.png
    • Gamepad_Enumeration.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
  • skia-windows-screenshots: 97 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ColorPickerSample.png-dark
    • DynamicFont.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CustomTitleBar_Tests.png-dark
    • DisplayInformation.png-dark
    • Gamepad_Enumeration.png-dark
    • Image_AnimatedWebP.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • ImageBrushAlignmentXY.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Gamepad_CurrentReading.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png

…ment

MediaPlayerPresenter now derives directly from FrameworkElement (matching
WinUI) instead of Border, dropping the extra Border level and its leaked
Child/BorderBrush/BorderThickness/CornerRadius/Padding surface. The video
surface is hosted via an internal Child slot (AddChild/RemoveChild) with
an ArrangeOverride; the 6 platform extensions reach it unchanged through
InternalsVisibleTo. MediaPlayerElement paints its black background on the
template root so letterbox bars stay black.

Compiled on Skia Desktop (incl. Win32/X11 media extensions); structural
reparent runtime-validated (Given_MediaPlayerPresenter). Video-hosting
behaviour and the non-desktop extensions need per-head validation.
Part of the 7.0 breaking-changes rollup (uno#8339).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260717/reparent-mediaplayerpresenter-to-fe branch from 73828b0 to 21a3378 Compare July 21, 2026 19:34
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 223424 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 98

Details
  • skia-linux-screenshots: 67 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • Gamepad_CurrentReading.png-dark
    • Buttons.png-dark
    • Buttons.png
    • DoubleImageBrushInList.png
    • Examples.png-dark
    • Examples.png
    • DataTransferManager.png
    • EllipsemaskingEllipseGrid.png
    • DynamicFont.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Gamepad_Enumeration.png-dark
    • ImageBrush_Stretch.png-dark
    • Image_Margin_Large.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • ElementLevelTheme.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
  • skia-windows-screenshots: 98 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Focus_FocusVisual_Properties.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • Gamepad_Enumeration.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Image_UseTargetSize.png-dark
    • DisplayInformation.png-dark
    • Buttons.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 223424 has failed on Uno.UI - CI.

@mergify

mergify Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Xiaoy312
Xiaoy312 merged commit 50fbe66 into feature/breakingchanges Jul 22, 2026
67 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260717/reparent-mediaplayerpresenter-to-fe branch July 22, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants