如何制作基本的媒体播放器来播放avi格式的视频? [英] How to make a basic Media player to play a video in avi format?

查看:91
本文介绍了如何制作基本的媒体播放器来播放avi格式的视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I want to play a video in Delphi. This is the code that I've got:

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

但是我收到一条错误消息:'指定的文件无法在指定的MCI设备上播放。文件可能已损坏,格式不正确,或者该格式没有可用的文件处理程序。'
我使用的视频格式为avi。
感谢您的所有帮助。

But I get an error message:'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.' The format of the video that I use is avi. All help is appreciated.

推荐答案

Delphi中的媒体播放器组件在我们的现代上存在兼容性问题 电脑。对于问题的确切原因,我不是很精明。最好在Delphi中制作自己的组件以播放媒体。

There is a compatibility issue with the media player component in Delphi on our "modern" computers. I'm not tech savvy on what exactly the problem is :P. It is best to make your own component in Delphi to play media.

此链接可以帮助您制作Windows Media Player组件,也可以对其进行调整以使其活动。 X媒体播放器组件-例如VLC。

This link can help you make a Windows Media Player component, or you can adjust it to make another active X media player component - such as VLC.

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

我希望这会有所帮助。 :D

I hope this will help. :D

这篇关于如何制作基本的媒体播放器来播放avi格式的视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆