-3

So I want to play a video in winform app, using Windows Media Player, I made everything that Microsoft said in their tutorial, but WMP doesn't play video, it can't "connect to it". And this is the only lines of code that I have for an app

private void Form1_Load(object sender, EventArgs e)
        {
            axWindowsMediaPlayer1.URL = "D:\\jumpscare.mp4";
        }

It finds the video, but it doesn't play it. Or it plays in the back while not showing that on-screen. And when the video "ends", the app crashes with code 3221225477 (0xc0000005) 'Access violation' (video's length is 3 seconds and the app crashes after 3 seconds). I tried different file type (.wmv) and it's the same thing.

Windows 11 Pro 22H2, Visual Studio Community 2022, .NET Framework 4.7.2

Beliy.
  • 9

1 Answers1

0

After searching relevant information, you can try the following steps:

  1. According to C# program crashes when setting media player URL of axWindowsMediaPlayer object from separate form window: code 3221225477 0xc0000005 Access violation, you need to use the nVidia Control Panel to use integrated graphics for the project's debug and release executables to prevent crashes. This forces them to only interact with the integrated graphics, preventing access violations.

  2. Use Visual Studio Installer to repair Visual Studio

  3. Reinstall Visual Studio

wenbingeng-MSFT
  • 1,546
  • 1
  • 1
  • 8