你好,親愛的社區相對路徑的視頻文件......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;