Mount an image and video player in delphi

3

I have a project for college and I do not know how I can solve it.

The idea is to make a video player and image together, so that I can put the images and videos in the same playlist and each item can only run 15 seconds.

I have a video player and picture ready already, but I can not merge the two to meet me. Follows links of the two projects: link

    
asked by anonymous 12.05.2015 / 07:30

2 answers

2

@Renato_Souza_Delphi, explaining very simply what I had mentioned in the other answer.

In Delphi in the menu bar go to:

  • Component / Component .
  • On the next screen choose Import ActiveX Control .
  • In the next screen, locate the grid :

  • SelectthenameofthepaletteasyouwishIleftasActiveX.

  • OnthenextscreenchoosetheInstallToNewPackageoptionandend.
  • Thenverifythatthecomponentpaletteyoudefinedearlier(step4)wascreatedinDelphi.
  • PutintheFormtheTWindowsMediaPlayercomponentofthisnewpaletteandaTimerbysettingitaslongasyouwant.
  • GotothepropertyofTWindowsMediaPlayerandsetitsAlignproperty:alClient.

  • >

    Implementation

    unit frmPrincipal; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.OleCtrls, WMPLib_TLB, Vcl.StdCtrls, Vcl.ExtCtrls; type TForm1 = class(TForm) wm: TWindowsMediaPlayer; Timer1: TTimer; procedure Timer1Timer(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } FIndex: Integer; FLista: TStringList; public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin FLista := TStringList.Create; FIndex := 0; FLista.Add('arquivo.png'); Flista.Add('arquivo.mp3'); Timer1.Enabled := True; end; procedure TForm1.FormDestroy(Sender: TObject); begin FreeAndNil( FLista ); end; procedure TForm1.Timer1Timer(Sender: TObject); begin if FIndex > 1 then Exit; wm.URL := FLista.Strings[FIndex]; wm.controls.play; Inc(FIndex); end; end.

    This is a simple example of what you can do easily with FLista.Add('arquivo.png') of windows media player, there are numerous methods and resources that you can implement any doubt is just talk, could not detail and write a consistent code for lack of time but I hope you got the idea.

        
  • 15.05.2015 / 02:57
    1

    Use the ActiveX control of windows media player that solves your problem since it can rotate videos and open JPEG. Import the ocx that is in the system32 folder and adapt the control to your needs.

        
    13.05.2015 / 18:04