Skip to content

Added DVD Player Sample using Avalonia#223

Open
ramzanbhutto wants to merge 3 commits intomfkl:masterfrom
ramzanbhutto:dvd-sample
Open

Added DVD Player Sample using Avalonia#223
ramzanbhutto wants to merge 3 commits intomfkl:masterfrom
ramzanbhutto:dvd-sample

Conversation

@ramzanbhutto
Copy link
Copy Markdown

@ramzanbhutto ramzanbhutto commented Mar 21, 2026

Closes #224

Added a cross-platform DVD player sample built with Avalonia UI and LibVLCSharp.

Built using

  • .NET 10 SDK
  • Avalonia 11.3.12
  • LibVLCSharp 3.9.6
  • LibVLCSharp.Avalonia 3.9.6
  • VideoLAN.LibVLC.Windows 3.0.23 (Windows)
  • VideoLAN.LibVLC.Mac 3.1.3.1 (macOS)

What's included

  • DVD ISO file picker via StorageProvider API
  • Play / Pause
  • Seek via timestamp slider
  • Volume control
  • Custom title bar with minimize, fullscreen and close

Test ISO

Tested with Big Buck Bunny NTSC DVD ISO (free and legal):
https://ia801907.us.archive.org/13/items/BigBuckBunny/big-buck-bunny-NTSC.iso

Linux note

Requires vlc-plugin-dvd and libdvdcss to be installed separately:
sudo pacman -S vlc-plugin-dvd libdvdcss

Platforms

  • Linux ✅ (tested)
  • Windows ✅ (via VideoLAN.LibVLC.Windows NuGet)
  • macOS ✅ (via VideoLAN.LibVLC.Mac NuGet)

@ramzanbhutto
Copy link
Copy Markdown
Author

The CI failures are pre-existing and unrelated to this PR. They are caused by missing NuGet assets and Android SDK on the pipeline machine. My sample builds and runs successfully.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be added to the .sln files for discoverability

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added to libvlcsharp-samples-mac.sln and libvlcsharp-samples-windows.sln files!

@mfkl
Copy link
Copy Markdown
Owner

mfkl commented Apr 13, 2026

Are you sure you tested this on Windows? Can you share a screenshot?

@ramzanbhutto
Copy link
Copy Markdown
Author

ramzanbhutto commented Apr 13, 2026

no as mentioned, i just tested in linux!
but i can also test in windows, just let me know?

@mfkl
Copy link
Copy Markdown
Owner

mfkl commented Apr 15, 2026

Yes please test on Windows

@ramzanbhutto
Copy link
Copy Markdown
Author

ramzanbhutto commented Apr 17, 2026

I tried to test on windows, but the only UI interface is showing. when i selected the .iso file(big-buck-bunny), then it shows nothing, just loading in the player. like:
image

I debugged this issue since yesterday but can't be able to solve this.
I even tried to return for specific OS like:
in OnOpenFile function in MainWindow.axaml.cs:

    var localPath= files[0].Path.LocalPath;
    string mrl= BuildDvdMrl(localPath);
    Console.WriteLine($"[DVD] MRL={mrl}");
    var media= new Media(libVLC, mrl, FromType.FromLocation);
    mediaPlayer.Play(media);
    media.Dispose();

and then created a function:

  private static string BuildDvdMrl(string localPath){
        if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
       return "dvd:///" + localPath.Replace('\\', '/');
       
    return "dvd://" + localPath;
}

even tried BuildDVDMrl function like:

      var path = localPath.Replace('\\', '/');      
      if (!path.StartsWith("/")){
          path = "/" + path;
      }

      if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)){
        return "file://" + path;
      }

      return "dvd://" + path;

but it works in linux, not windows.

In windows, .iso file is working with VLC but not with this sample.
kindly help me out

@ramzanbhutto
Copy link
Copy Markdown
Author

ramzanbhutto commented Apr 19, 2026

This sample works on Linux; I haven't tested it on Mac as I don't have a MacBook. However, for Windows, I can create a DVD player in WinUI3 or .NET MAUI since I'm facing some issues with path for DVD on Windows. What do you suggest, and is the sample I built in Avalonia acceptable?

@mfkl
Copy link
Copy Markdown
Owner

mfkl commented Apr 20, 2026

However, for Windows, I can create a DVD player in WinUI3 or .NET MAUI since I'm facing some issues with path for DVD on Windows.

No this should work on Avalonia, changing UI is not the correct approach.

What do you suggest, and is the sample I built in Avalonia acceptable?

Yes, I will debug the windows version when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants