How to remove the last frame of the played video in LibVlcSharp
22:32 01 Jul 2026

After I play a video on Libvlcsharp and it reaches the End, the last Frame is kept displayed, and it only goes away if I play another video. Is there a way to remove it or set it to black color instead? I have tried to dispose of the media, but it doesn't change anything!

public partial class FirstViewModel : ViewModelBase
{
    private LibVLC MainLibVLC { get; set; }
    public MediaPlayer MainMediaPlayer { get; set; }
    [ObservableProperty] string movieUrl = "";

    public FirstViewModel()
    {
        MainLibVLC = new();
        this.MainMediaPlayer = new(MainLibVLC);
        this.MovieUrl = Path.Combine(Environment.CurrentDirectory, "sample.mp4");
    }

    [RelayCommand]
    public void Play()
    {
        var media = new Media(MainLibVLC, new Uri(this.MovieUrl));
        this.MainMediaPlayer.Play(media); 
    }

    [RelayCommand]
    public void Stop()
    {
        this.MainMediaPlayer.Stop();
    }

    [RelayCommand]
    public void ResetCurrentFrame()
    {
        // Reset the Current frame to be Black, 
        this.MainMediaPlayer.Stop();
        this.MainMediaPlayer.Media?.Dispose();

    }
}
c# avaloniaui libvlcsharp