I am attempting to build a UnoPlatform app which has the capability to play some embedded mp3 sound effect files.
Using MediaPlayerElement, it is straight-forward to play media from HTTP sources, however it seems there must be some platform specific hoops to jump through to get embedded resource files to play.
The following event handler works for UWP, but not IOS, Android, or WebAssembly:
private void SpinButton_OnClick(object sender, RoutedEventArgs e)
{
player1.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/Sound.mp3"));
}
I have attempted to follow the info here https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/mediaelement for how to embed the media on IOS, but it does not seem to work for me.
Is there a trick to this? is there a sample out there with this working?