Hi @Zhe-Yu Lee , Welcome to Microsoft Q&A,
You can use the Windows Media Player controls instead to achieve what you need.
- Open Visual Studio and load your WinForm project.
- Open the Toolbox, right-click anywhere in the Toolbox, and select "Choose Items... )。
- In the dialog box that pops up, switch to the "COM Components" tab.
- Find and tick "Windows Media Player" and click "OK"
using System;
using System.Windows.Forms;
namespace VideoPlayer
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
// Set the path of the video file
axWindowsMediaPlayer1.URL = @"C:\path\to\your\video.mp4";
// Start playing the video
axWindowsMediaPlayer1.Ctlcontrols.play();
}
}
}
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.