'UNO Platform: Droid Project - Media Player element will not play mp4 from project file

New to UNO Platform. Working on a test project and having trouble playing mp4 using MediaPlayerElement on Droid. MyVideo.mp4 is in Shared/Assets/Videos with Build Action = Content; and Copy to Output Directory = Do Not Copy. Have tried setting to embedded project; placing it under the Droid Assets/Raw/MyVideo.mp4 with a Build Action = AndroidResource. Tried adding permission to READ_EXTERNAL_STORAGE to the AndroidManifest.xml. Have tried several different versions of paths. Project is on Windows 10 PC using VS2019/UNO Platform being built to Samsung 2016 tablet. App loads, no errors, poster displays correctly, transport controls display, but the video won't play.

Here's the XAML.

<Grid>
    <MediaPlayerElement x:Name="mediaPlayer" 
                  HorizontalAlignment="Center" 
                  VerticalAlignment="Top" 
                  Stretch="Uniform" 
                  AutoPlay="True"
                  Source="ms-appx:///Assets/Videos/MyVideo.mp4"
                  PosterSource = "ms-appx:///Assets/Posters/MyPoster.jpg"
                  AreTransportControlsEnabled="True">
        <MediaPlayerElement.TransportControls>
            <MediaTransportControls IsCompact="True" RequestedTheme="Dark" />
        </MediaPlayerElement.TransportControls>
    </MediaPlayerElement>
</Grid>

The code behind is empty except for the this.InitializeComponent(); in the constructor.

Any help is greatly appreciated. Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source