Playing Media Files

Applies to HTML Viewer, IE Browser publications.

There are several ways to play music or video in publications and ebooks made with HTML Executable. In all cases, players require media files to be either delivered by the built-in HTTP server or made available physically on the hard disk in order to play them, so the runtime module may have to temporarily extract them.

For large media files, you can keep them outside the publication .EXE file (Windows handles EXE filesizes up to 4 GB only): they are considered as external files. Moreover, HTML Executable allows you to encrypt your external files so that these files can only be played by the publication or ebook. Refer to the Encrypt External Files topic.

Using HTML5 to play audio and video

See dedicated topic for HTML5 audio and HTML5 video playing.

Using Flash to play MP3

Demonstration:

Example not available in this online documentation: please run the offline help from HTML Executable to have a working example.

Any MP3 player written in Flash should work. For instance, we used Dewplayer. Dewplayer is under Creative Commons license. The usage is totally free even for commercial purposes (but not reselling it).

If you have troubles playing MP3, use a full URL beginning by ghe://heserver/ + virtual path to the MP3 to play. For instance, see the code below.

HTML code:

<object id="mp3" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" 
height="240" type="application/x-oleobject" width="320">
<param name="url" value="ghe://heserver/media/swan.mp3" />
<param name="sendplaystatechangeevents" value="false" />
<param name="autostart" value="false" />
<param name="uimode" value="mini" />
</object>

Using Silverlight to play Windows Media Video (WMV) and other media types

Example not available in this online documentation: please run the offline help from HTML Executable to have a working example.

The Silverlight plugin is JW WMV Player licensed under a Creative Commons License. It allows you to use, modify and redistribute the script, but only for noncommercial purposes. For corporate use, please apply for a commercial license.

Using Windows Media Player

IMPORTANT: we recommend you to use Silverlight instead of Windows Media Player to play Windows Media files.

Play MP3 audio files:

Example not available in this online documentation: please run the offline help from HTML Executable to have a working example.

HTML code for this example:

<object id="mp3" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" height="240"
type="application/x-oleobject" width="320">
<param NAME="URL" VALUE="media/swan.mp3">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="False" />
<PARAM NAME="AutoStart" VALUE="False" />
<PARAM name="uiMode" value="mini" />
</object>

Play WMV video files:

Example not available in this online documentation: please run the offline help from HTML Executable to have a working example.

HTML code for this example:

<object id="mp3" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" height="240"
type="application/x-oleobject" width="320">
<PARAM NAME="URL" VALUE="sunpeek2.wmv">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="False" />
<PARAM NAME="AutoStart" VALUE="False" />
<PARAM name="uiMode" value="mini" />
</object>

Playing media files in external applications thanks to special targets

You can have links with HTML Executable special targets in your publication. Just add a hyperlink to a media file you want to play, set the target attribute to _heopenit and that’s all. The end user’s default media player will be launched to play the file.

Example not available in this online documentation: please run the offline help from HTML Executable to have a working example.

HTML syntax for this example:

<a href="media/swan.mp3" target="_heopenit">

It works with any media type (AVI, OGG…) provided that a player is available on the end user’s computer. Otherwise, an error message will be displayed.


Copyright G.D.G. Software 2018. All rights reserved