如何制作一个基本的媒体播放器来播放 avi 格式的视频?

How to make a basic Media player to play a video in avi format?

我想在 Delphi 中播放视频。 这是我得到的代码:

if OpenDialog1.Execute  then
 begin
  MediaPlayer1.FileName:=OpenDialog1.FileName;
  MediaPlayer1.Open;
  MediaPlayer1.Display:=pnlVideo;
  MediaPlayer1.Play;
 end;

但我收到一条错误消息:'The specified file cannot be played on the specified MCI device.The file may be corrupt, not in the correct format or no available file handler available for this format.' 我使用的视频格式是avi。 感谢所有帮助。

我们 "modern" 台计算机上 Delphi 中的媒体播放器组件存在兼容性问题。我不懂技术到底是什么问题:P。最好在Delphi中制作自己的组件来播放媒体。

这个 link 可以帮助您制作一个 Windows 媒体播放器组件,或者您可以调整它以制作另一个活动的 X 媒体播放器组件 - 例如 VLC。

https://chapmanworld.com/windows-media-player-in-delphi/

希望对您有所帮助。 :D