[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

Play Mpegmovies with Delphi

I'm writing an mutimedial CD-Rom and want to play some movies. Instead of the standard avi-format I want to use mpeg movies. Is there a free component to manage this?
0
redforce
Asked:
redforce
1 Solution
 
Phoenix_sCommented:
use the TMediaPlayer component in Delphi (depends which version of delphi you use)  that should play most of the mpegs. Mind you... another gentleman here is having difficulties playing some mpeg formats with delphi 3's TMediaPlayer and that may be an incompatability issue. Other than that, I recommend combing the free component sections of several popular delphi pages... OR... use OLE automation to launch the Windows Media Player with the file you want played.  Windows media player should be the most accurate player of mpegs around, and it will auto download new codecs if needed.
0
 
xpherCommented:
I had same problem. I solved it by putting the setup program for Active Movie on the CD. When the CD  is started I have a small test file to attempt to open (which is not shown) if this is not there then I launch a setup option for Active Movie. I have this in my project source, this is just a snippet as there is allsorts of other things going on.

 try
      Application.ShowMainForm := False;
      with MainForm.MediaPlayer1 do
        begin
          FileName := 'video\test.mpg';
          Open;
        end;
      //my other stuff
      Application.Run;

      except on EMCIDeviceError do
      begin
      s := MessageDlg('You do not appear to have the correct drivers installed'
                + ' for viewing the videos in this software. '
                +'Would you like to install them now?',
                 mtError,[mbOK, mbCancel],MB_TASKMODAL);
        case s of
          1:begin
              Command := 'amov\amov4ie.exe' + #0;
              if WinExec(@command[1], SW_SHOWNORMAL) < 32 then
              MessageDlg('Failed to execute', mtError, [mbOK], 0);
              Application.Terminate;
            end;
          2: Application.Terminate;
      end;

end
  else
  begin
   Application.ShowMainForm := True;
   MainForm.Visible := True;
  end;
  end;
  end;  
Application.Run;  

As I say this isn't a complete piece but hope it gives an idea of what I mean.

cheers
chris
0
 
bryan7Commented:
listenning..

0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
redforceAuthor Commented:
My code should check like xpher wrote, if the computer could play mpeg files. The best thing would be if it add the code automatic from my programm if needed, so that the user don't see it.
0
 
xpherCommented:
I don't think this can be done without user knowing you are installing to their machine. Plus it is probably only fair to be honest about what you are doing. I have had no negative feedback only positive for the way I achieved it.

regards
xpher ;)
0
 
TheNeilCommented:
You can just use the standard Delphi TMediaplayer component...just so long as you have your MPEG CODEC installed correctly. Be warned though, for some MPEG files you might need dedicated hardware to handle the compression/decompression
0
 
xpherCommented:
This wont work if codecs etc not installed on user's machine.

xpher
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now