你好,亲爱的社区相对路径的视频文件......Inno Setup的 - 与作为闪屏
我刚看到这个题目的视频闪屏的Inno Setup的
Video file (with alpha) as splash-screen?
通过给出的示例代码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 '[email protected]:mediaplayer.dll stdcall';
function DSStopMediaPlay: Boolean;
external '[email protected]:mediaplayer.dll stdcall';
function DSInitializeVideoFile(FileName: WideString; WindowHandle: HWND;
var Width, Height: Integer; CallbackProc: TDirectShowEventProc): Boolean;
external '[email protected]: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;