BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Uno Platform 4.9: Media Player Element, WebView2 and Native Host Support for Skia

Uno Platform 4.9: Media Player Element, WebView2 and Native Host Support for Skia

This item in japanese

Earlier this week, Uno Platform released version 4.9 of their framework for building native mobile, desktop, and WebAssembly apps. The latest version brings the MediaPlayerElement control and WebView2 support which are two community long awaited features. Also, beyond these additions, the release includes over 100 other improvements and enhancements, including the native host support for Skia.

The first notable feature is a community of highly anticipated MediaPlayerElement control from Windows UI to iOS, Android, and Mac Catalyst platforms through the Uno Platform. Additionally, Uno Platform 4.9 expands its reach by introducing support for Web and Linux targets, with the Linux target utilizing libVLC for media rendering. Detailed instructions on utilizing the MediaPlayerElement can be found in the official documentation.

Regarding the MediaPlayerElement control, Uno Platform Team states the following:

Whether your target is iOS, Android, Web, Mac, Linux, or Windows itself, this guarantees consistent and seamless media playback experiences across devices.

Another bigger feature is that support for the WebView2 control has been introduced for Android, iOS, and Mac Catalyst platforms. This control enables users to navigate to external web content and display custom HTML content, providing versatile functionality. It also facilitates communication between C# and JavaScript, allowing for powerful embedding scenarios such as interacting with JavaScript charting or data grid components. The WebView2 control replaces the previous WebView "1" in WinUI, offering an expanded feature set and ensuring a seamless migration for existing scenarios.

Furthermore, another big addition is regarding the Native Host Support for Skia. It enables the integration of native controls for enhanced platform integration. This new feature empowers the ContentControl component to accept native instances, such as GTK Widgets or WPF FrameworkElements, and render them on the Uno Platform's surface, utilizing the allocated size of the associated ContentControl.

Notably, the original blog post reports that this capability has been used successfully in the implementation of MediaPlayerElement support, ensuring the precise placement of video surfaces. Embedding Native Controls in Skia Apps documentation article is also available for developers to explore and learn more about.

In the original blog post, the Uno Platform team provided the code example which will create a new Gtk CheckButton control displayed on top of the Uno Platform Skia canvas.

<ContentControl x:Name="MyControl">
    <ContentControl.Content>
        <CheckButton xmlns="using:Gtk" />
    </ContentControl.Content>
</ContentControl>

Other notable changes and improvements include indexer and MVVM toolkit support for x:Bind expressions, UIElement.ActualOffset support, and ms-appdata support for loading app-packaged SVGs through SvgImageSource. The update also introduces significant performance improvements for WebAssembly using JSImport/JSExport, as well as enhanced performance and memory optimizations in the XAML Generator. Notably, TextBlock rendering for Skia heads has undergone performance enhancements. Additionally, Visual Studio 2019's Uno Platform Solution Templates are now being deprecated. These updates collectively contribute to a more robust and efficient development experience with Uno Platform 4.9.

Lastly, developers interested in learning more about the Uno Platform can visit the official website for very detailed documentation which contains how-tos and tutorials about the platform, alongside the official GitHub repository, and a more detailed full list of improvements is available at the release changelog.

About the Author

Rate this Article

Adoption
Style

BT