Embedded Media

As EPUB 3 gains support on devices, it is becoming much more common for publishers and authors to embed media content into their eBook files. This page will cover some of the technical aspects of embedding video and audio in your EPUB files. However, please note the following general rules about this topic:

A Note About Amazon

Current retailer suport for video and audio can be confusing, and Amazon's support is certainly in that camp. Most people think that because you can watch movies on the Kindle Fire tablets you should also be able to embed video and audio into Kindle eBooks. However, it is not as simple as that. Kindle Format 8 (KF8), Amazon's latest eBook format, does not have support for embedded media, but their older Mobipocket 7 format does. This means that when you embed media into your Kindle eBook, what the reader gets on their Fire device is the Mobipocket 7 version of the book. This means that all of the extra formatting (CSS support) that is available in KF8 will not be seen by your readers. It is important, then, to spend extra effort to ensure that the file looks good despite these limitations. For more information on that, see the Kindle Publishing Guidelines.

Video

While there is some variation among retailers for what kinds of video files they accept, publishers usually want to create one file that will work everywhere. To that end, the following Standard Definition (SD) specifications can be used as a baseline for your video files and should work on most of the reading systems with video support, while the High Definition (HD) specifications are mostly intended for Apple only. It is important to note that EPUB 3 does not require reading systems to support video content, and the following technical details are not part of the EPUB 3 specification itself. They are only recommendations based on current reading system support among the major U.S. eBook retailers.

Standard Definition/Single Source

High-Definition (Apple iBooks only)

Poster Frame Images

All videos must have a poster frame image (the image that displays on the page when the video is not playing). The “Play” button will be automatically superimposed over the image, so please exclude this from your poster frame images.

HTML Markup

Here is some example markup for embedded video. Each piece will be explained below.

<video id="video01" src="audiovideo/myvideo.mp4" controls="controls" poster="images/myvideo.png">There is video content at this location that is not currently supported on your device. Please visit our website, <a href="http://www.example.com">www.example.com</a>, to watch the videos on your computer.</video>
<p class="caption">Video with important information (2:03)</p>

id: A unique identifier of the video. Not reqired, but can be helpful when linking to the video in your Table of Contents.

src: This points to the location of video file itself, which must be inside the EPUB package. It is best to place all audio and video files in a folder called "audiovideo".

controls: This allows the reader to access the video controls for play, pause, etc. The value is actually unimportant because the presence of the controls="" attribute itself turns on the controls.

poster: This points to the poster frame, which will be displayed when the video is not playing (please see the specs above). It can be located anywhere inside the EPUB.

"There is video...": This is a fallback. You can include a variety of things here, but normally it is either an image or some text explaining where the reader can access the same video content online.

caption: Amazon recommends including a caption with each video that describes what is in the video and that tells how long it lasts. This is a good practice for accessibility, as well. The class name is not required.

Audio

Following are the recommended specs for audio content embedded in EPUB 3 files. Unfortunately, the major retailers do not all support the same audio file formats, so you may need to prepare separate documents for different retailers.

HTML Markup

Here is some example markup for embedded audio. Each piece will be explained below.

<audio id="audio01" src="audiovideo/myaudio.m4a" controls="controls">There is audio content at this location that is not currently supported on your device. Please visit our website, <a href="http://www.example.com">www.example.com</a>, to listen to the audio on your computer.</audio>
<p class="caption">Audio with important information (1:36)</p>

id: A unique identifier of the audio. Not reqired, but can be helpful when linking to the audio in your Table of Contents.

src: This points to the audio file itself, which must be inside the EPUB package. It is best to place all audio and video files in a folder called "audiovideo".

controls: This allows the reader to access the audio controls for play, pause, etc. The value is actually unimportant because the presence of the controls="" attribute itself turns on the controls.

"There is audio...": This is a fallback. You can include a variety of things here, but normally it is some text explaining where the reader can access the same audio content online.

caption: Amazon recommends including a caption with each audio file that describes what is in the audio and that tells how long it lasts. This is a good practice for accessibility, as well. The class name is not required.

Back to Handbook