2

Can someone tell me how to play AVI files with FireMonkey? Which component should I use?

I searched in all componenets but didn't find anything useful.

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
Hidden
  • 3,598
  • 4
  • 34
  • 57
  • 1
    check this example http://docwiki.embarcadero.com/RADStudio/XE3/en/Building_a_Basic_Media_Player – Raul Mar 11 '13 at 10:49
  • 1
    Depending on your Delphi version, [`XE3 Audio-Video in FireMonkey`](http://docwiki.embarcadero.com/RADStudio/XE3/en/Audio-Video_in_FireMonkey) or [`Delphi XE2 : How can I play video files with firemonkey`](http://stackoverflow.com/q/8130097/576719). – LU RD Mar 11 '13 at 10:56

1 Answers1

7
  1. Add TMediaPlayer to your form
  2. Add TMediaPlayerControl to your form
  3. Add TButton to your form
  4. Duoble click on your button
  5. Insert this between begin and end tag

if MediaPlayer1.Media <> nil then begin MediaPlayer1.Play; end;

It should look like this:
Screenshot

  1. Change C:\earth.avi to the location of your avi file

Result:

Screenshot

fnkr
  • 9,428
  • 6
  • 54
  • 61
  • Can you play it with the Windows Media Player? Maybe a missing codec or so? – fnkr Apr 07 '13 at 13:40
  • Yes, Windows Media Player plays it correctly, even I test it with Windows 7 sample video(Wildlife.wmv), but this method cannot play it too!!! – sma6871 Apr 07 '13 at 14:27
  • Maybe contact FireMonkey support? I have no idea what's wrong, sorry. – fnkr Apr 07 '13 at 21:45