Hi guys I am using MediaElement in Xamarin for video playback of local device files.
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/mediaelement
The issue I am having is being able to release the video source for MediaElement. I call Stop() and set the Source property to null, yet the last video is still loaded into the MediaElement with playback capabilities.
Am I missing something or is this a bug?
Here is some of the related code:
<MediaElement
HeightRequest="200"
ShowsPlaybackControls="True"
BackgroundColor="#141d3d"
Grid.Row="1"
Aspect="AspectFill"
AutoPlay="True"
IsVisible="{Binding IsVideoVisible}"
Source="{Binding AnprVidSource}"
x:Name="meAnpr"
KeepScreenOn="True" />
Assigning a local address to the source property.
AnprVidSource = UserVideo.Path;
Code trying to clear the MediaElements source which seems to do nothing
meAnpr.Stop();
meAnpr.IsEnabled = false;
viewModel.AnprVidSource = null;