A custom script for ver 3 does not work in ver 4

Several years ago, you wrote a custom script for me (for HTMLexe ver3).
It provided functionality so that I could have a link in a webpage that would open a video player .
Clicking the link would launch the user’s default video player – the videos were stored in a folder
[videos] outside of the executable. But in ver 4 the script is not working.

You originally wrote the file for .mp4 files, but now my videos are
in .wmv format, so I have changed the script accordingly.

Why doesn’t the script work anymore?
I’m using Windows 8.
My default video player is VLC.

I try to avoid using Windows Media Player – I may have even tried to uninstall it,
but the .wmv file extension is associated with VLC, so I do have a player for wmv files.

(The script, and your instructions follows:)

First, open your HEPX project and go to the User Script editor:
Paste this in the script file:

procedure StartVideo(Filename: String);
var
EbookPath, MyProgram: String;
begin
// Read the path to the folder that contains our ebook .exe
EbookPath := GetGlobalVar(“HEPublicationPath”, “”);
// Construct the path to the wmv file we want to launch.
// Video wmv files are located in the [videos] subfolder.
MyProgram := EbookPath + “videos” + Filename + “.wmv”;
// Execute the program!
if OpenFile(MyProgram, “”, SW_SHOWNORMAL) < 32 then
begin
MessageBox("Unable to execute the external file: " + MyProgram, “Ebook Error”, MB_OK+MB_ICONERROR);
exit;
end;
end;


Click Save Script.
Now you can use the following hyperlink code in any HTML page to start an wmv file located in the subfolder “videos”:

Show video 1


Show video 2

After the | character in the link, enter the filename of the wmv file you want to play. Don’t add the .wmv extension, the script adds it for you. Now the publication can launch external wmv files in the default media player of the end user. And it doesn’t use hardcoded paths since the drive letter can change on different computers…

[end]

Replied to your email.

Please clarify this:

I am linking to a .wmv file.
Is there any way (maybe a script?) I can tell the player (either WMP, VLC, etc)
to close, or minimize when the video is done playing, so it does not block
the HTMLexe window? I am creating a teacher’s guide for an educational video,
and we’ve found that the teachers don’t always understand they need to close
the video player window to continue.

You cannot tell which player to choose unfortunately. We use the default player because it’s generally the one that end users prefer to use…