Hola Euge10.
Una forma en que podes reproducir el video al mismo tiempo (casi) en dos forms es:
Código Delphi
[-]
...
uses MMSystem, Unit2;
procedure TForm1.btnPlayClick(Sender: TObject);
const
FILE_NAME = 'C:\Users\Public\Videos\Sample Videos\Butterfly.wmv'; begin
mciSendString('close video1', nil,0, 0);
mciSendString('open "' + FILE_NAME + '" alias video1', nil, 0, 0);
mciSendString(PChar('window video1 handle ' + IntToStr(Handle)), nil,0,0);
mciSendString(PChar('put video1' + Format('%d %d %d %d',[Left,Top,Width,Height])),nil,0,0);
mciSendString('play video1', nil, 0, 0);
with Form2 do
begin
Show; mciSendString('close video2', nil,0, 0);
mciSendString('open "' + FILE_NAME + '" alias video2', nil, 0, 0);
mciSendString(PChar('window video2 handle ' + IntToStr(Handle)), nil,0,0);
mciSendString(PChar('put video2' + Format('%d %d %d %d',[Left,Top,Width,Height])),nil,0,0);
mciSendString('play video2', nil, 0, 0);
end;
end;
También podes reproducir el video en varios
TPanel dentro de un mismo form. Pone algunos panels dentro del form (2, 4,... ) y probá este código:
Código Delphi
[-]
...
uses MMSystem;
procedure TForm1.btnPlayClick(Sender: TObject);
const
FILE_NAME = 'C:\Users\Public\Videos\Sample Videos\Butterfly.wmv'; var
i: Integer;
str: string;
begin
for i:= 0 to ComponentCount-1 do
begin
if Components[i] is TPanel then
with TPanel(Components[i]) do
begin
str:= 'video'+IntToStr(i+1);
mciSendString(PChar('close video' + str), nil, 0, 0);
mciSendString(PChar('open "' + FILE_NAME + '" alias video' + str), nil, 0, 0);
mciSendString(PChar('window video'+ str +' handle ' + IntToStr(Handle)), nil, 0, 0);
mciSendString(PChar('put video'+ str + Format('%d %d %d %d',[Left, Top, Width, Height])), nil, 0, 0);
mciSendString(PChar('play video'+ str), nil, 0, 0);
end;
end;
end;
Saludos.