(1) Create a project file
(2) Select File | New Form to create a form and set its name: = Form2
(3) Set Form2.Borderstyle: = BSNONE
(4) Place a MedialPlayer component on Form2
(5) Place a PANEL component on Form2, set its name: = Panel1
(6) Set panel1.align: = alclient
(7) Add the following code added to the button1 of Form1:
Procedure TFORM1.BUTTON1CLICK (Sender: TOBJECT);
Begin
WITH FORM2 DO
Begin
WindowsTate: = WSMAXIMIZED;
Mediaplayer1.notify: = false;
MediaPlayer1.display: = panel1;
MediaPlayer1.FileName: = 'c: /temp/cool.avi';
Mediaplayer1.open;
Mediaplayer1.displayRect: = form2.clientRect;
Mediaplayer1.play;
END;
END;
(8) Add the following code to the ONNOTIFY event of Form2 MediaPlayer1
Procedure TFORM2.MEDIAPLAYER1NOTIFY (Sender: TOBJECT);
Begin
if MediaPlayer1.notifyValue = NVsuccessful
THEN FORM2.CLOSE;