0

I use TMediaPlayerControl to show video in my application.

This is my code to show video:

TrailerMediaPlayer.FileName := GetcurrentDir + '\Trailer\Trailer.avi';
if (TrailerMediaPlayer.State = TMediaState.Stopped) and
  (TrailerMediaPlayer.CurrentTime < TrailerMediaPlayer.Duration) then
begin
  TrailerMediaPlayer.Play;
  PositionTrackBar.Max := TrailerMediaPlayer.Duration;
end
else
begin
  TrailerMediaPlayer.CurrentTime := 0;
end;

It works on Windows 7/8, but in Windows XP I get unsupported media file error!

Note that Windows Media Player plays my Trailer.avi in Windows XP.

How can I play this video on every Windows OS (since XP) without any extra components?

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
sma6871
  • 3,198
  • 3
  • 38
  • 52

1 Answers1

0

Get madexcept, or any other similar tool and post the stack of the application. Also, this should be a problem with codecs and other applications installed on the machine, even the movie is played in XP's Windows Media Player.

As several suggestions : use the Windows Media Player ActiveX or the ActiveX plugin from VideoLan.

Also be sure to follow this http://docwiki.embarcadero.com/Libraries/XE3/en/FMX.Media.TMediaPlayerControl and http://docwiki.embarcadero.com/RADStudio/XE3/en/Building_a_Basic_Media_Player

PS: Be aware that FireMonkey is not VCL - http://docwiki.embarcadero.com/RADStudio/XE3/en/Converting_from_VCL_to_FireMonkey and do not mix these two. (I'm just suspecting you're doing it, so without the code I can not be sure of it...)

RBA
  • 12,337
  • 16
  • 79
  • 126
  • I do everything in [this article](http://docwiki.embarcadero.com/RADStudio/XE3/en/Building_a_Basic_Media_Player), but in a new Windows XP (without any codec) application throws an exception that is the media file not supported, however Media Player played it!!! – sma6871 Apr 07 '13 at 11:30
  • even I don't like those exclamation marks, can you post a small example of what you've done and the stack of the exception as I suggested you to do in the answer? – RBA Apr 07 '13 at 11:37
  • I have no more important code. The code in my question is in `PlayButtonClick` event and it works on my Windows 8. – sma6871 Apr 07 '13 at 12:03