unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.76k stars 706 forks source link

WASM: Media player fails to load local asset #17771

Open baskren opened 1 month ago

baskren commented 1 month ago

Current behavior

In WASM platform, Media player fails to load local asset.

        MediaPlayer.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/Sounds/Alarm.mp3"));
        MediaPlayer.Play();

NOTES:

Expected behavior

Local assets are loaded by WASM MediaPlayer, just as they are with other platforms

How to reproduce it (as minimally and precisely as possible)

Demo Project: https://github.com/baskren/WasmMedia

Workaround

Build custom media player?

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

5.3.90

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

Microsoft Visual Studio Community 2022 (ARM 64-bit) - Current Version 17.10.4

Relevant plugins

n/a

Anything else we need to know?

No response

jeromelaban commented 1 month ago

Thanks for the report. This feature is not implemented at this time, we're tracking this as part of https://github.com/unoplatform/uno/issues/2642.