你好,亲爱的社区......
我刚看到这个题目的视频闪屏的Inno Setup的
视频文件(阿尔法)作为启动画面?
通过TLama(汇创媒体播放器的作者)所提出的示例代码是伟大的,但它有一个小问题 - 这就是它:是指在代码中飞溅的视频文件有像绝对路径:d:\ Video.avi所以,如果我要发布我安装程序到其他计算机上的绝对路径像d:\ Video.avi将不再工作...
因此,我要求作者(TLama)修改该脚本,使视频文件飞溅使用相对路径,如:{SRC}或{} TMP。
那要问作者的第二次修订是:
我想通过点击一个窗口的客户区来实现视频播放结束......,是不是在上面的示例代码中...
所以最后我问了TLama(汇创媒体播放器的作者),以实现两个要求修订如下代码:
[Setup]
AppName=Media Player Project
AppVersion=1.0
DefaultDirName={pf}\Media Player Project
[Files]
Source: "MediaPlayer.dll"; Flags: dontcopy
[Code]
const
EC_COMPLETE = $01;
type
TDirectShowEventProc = procedure(EventCode, Param1, Param2: Integer);
function DSPlayMediaFile: Boolean;
external 'DSPlayMediaFile@files:mediaplayer.dll stdcall';
function DSStopMediaPlay: Boolean;
external 'DSStopMediaPlay@files:mediaplayer.dll stdcall';
function DSInitializeVideoFile(FileName: WideString; WindowHandle: HWND;
var Width, Height: Integer; CallbackProc: TDirectShowEventProc): Boolean;
external 'DSInitializeVideoFile@files:mediaplayer.dll stdcall';
var
VideoForm: TSetupForm;
procedure OnMediaPlayerEvent(EventCode, Param1, Param2: Integer);
begin
if EventCode = EC_COMPLETE then
VideoForm.Close;
end;
procedure OnVideoFormShow(Sender: TObject);
begin
DSPlayMediaFile;
end;
procedure OnVideoFormClose(Sender: TObject; var Action: TCloseAction);
begin
DSStopMediaPlay;
end;
procedure InitializeWizard;
var
Width: Integer;
Height: Integer;
begin
VideoForm := CreateCustomForm;
VideoForm.Caption := 'Popup Video Window';
VideoForm.BorderStyle := bsNone;
VideoForm.FormStyle := fsStayOnTop;
VideoForm.Position := poScreenCenter;
VideoForm.OnShow := @OnVideoFormShow;
VideoForm.OnClose := @OnVideoFormClose;
if DSInitializeVideoFile('d:\Video.avi', VideoForm.Handle, Width,
Height, @OnMediaPlayerEvent)
then
begin
VideoForm.ClientWidth := Width;
VideoForm.ClientHeight := Height;
VideoForm.ShowModal;
end;
end;
procedure DeinitializeSetup;
begin
DSStopMediaPlay;
end;