Playing Media Files

imgApplies 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.

Using Flash to play MP3

imgDemonstration:

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).

imgHTML code:

 <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>

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

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

img

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

imgPlay MP3 audio files:

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>

imgPlay WMV video files:

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.

Play a MP3 file

Play a WMV file

imgHTML 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.


About

This is the online documentation of HTML Executable.

About HTML Executable

HTML Executable is a versatile HTML compiler and ebook compiler: it lets you create secure ebooks and desktop applications with your websites, HTML or PDF documents.

You can easily create attractive ebooks, full-featured HTML applications (RIA) and software, digital publications from your websites, PDF files and HTML documents for online or offline distribution.

Learn more - Free Trial