Media types are used by reading systems as a way of understanding in advance what type of content a file contains. The following table lists some of the most common file formats and their corresponding media type values:
|File Format||Media Type|
EPUB defines a set of what are called core media types — file formats that can be included in publications without the need for fallbacks.
Reading systems are effectively required to support these formats so long as they support the necessary rendering (e.g., a reading system that only reads back the text does not have to support CSS or image formats, but a reading system with a visual display does).
Using only core media types in EPUB publications helps ensure that they will be readable regardless of the reading system in use.
The complete lists of supported media types are provided in each version of the EPUB specification:
Although the EPUB format tries to accommodate as many widely-supported file formats as reasonable for publishing, there are occasions when a format is needed that is not in the core set. A reading system might support a new advanced image format, for example, before others.
To help publishers take advantage of formats that are not widely supported without compromising the readability of a publication, EPUB leverages both its own fallback methods and those natively available in HTML. So long as a fallback is provided to a core media type, any file format can be added to an EPUB publication.
The following subsections review the fallback mechanisms that are available.
Most HTML elements that allow content to be embedded in a page provide a means of including fallback content when the primary source is not available or cannot be rendered.
video elements, for example, both allow the use of
source elements to provide media in more than one format.
video elements, the nested content of an
object element represents a fallback.
Embedding fallback images used to be problematic, but the addition of the
picture element have greatly improved the situation (the lack of
fallbacks was a major reason for the creation of manifest
fallbacks in EPUB).
EPUB 3 also exempts the following elements from fallback requirement:
linkwhen it has the
pronunciation(to allow pronunciation lexicon files);
track(so any captioning, subtitling, and similar audio/video track formats can be included);
video(EPUB does not define a single video format that all reading systems must support).
In these cases, any format can be specified, but there are no guarantees that reading systems will support rendering of the format.
Manifest fallbacks are named for how they are implemented in the EPUB package document.
manifest element is used to list all the resources used in the publication,
and each item in it can specify another item as a fallback using the
There are two places that manifest fallbacks are used. The first is to include unknown media types in the spine (i.e., to make them documents in the publication reading order). This practice has largely fallen into disuse, however, as it was used primarily in EPUB 2 to allow SVG images in the spine with XHTML fallbacks.
In this case, if the reading system does not support SVG, it follows the
fallback attribute references until it finds a media type it can support. In
the above case there is only one fallback, but it is possible to keep falling back through
multiple items before reaching a supported media type. The only requirement on fallback
chains is that they must include a core media type.
The other place where manifest fallbacks are used is to provide a fallback image for the
img element. Until the recent addition of the
and creation of the new
picture element, it was not possible in HTML to provide
a fallback for images embedded using the
img element. As a workaround, reading
systems are expected to change the source of the
img element to the fallback
specified in the manifest.
It is best to avoid manifest fallbacks for images except in EPUB 2 where there is no other option. They are not well supported.
Another fallback method unique to EPUB called bindings, was created to provide fallbacks for scripted content. This method has already been formally deprecated so should similarly be avoided.
EPUB allows the following types of content to be hosted on the web instead of stored inside the ZIP container:
- Audio files
- Video files
- Font files
- Resources retrieved by scripts (not the actual script code)
Caution needs to be exercised in such cases, however. There is no guarantee that users will have access to download remotely-hosted content, and no guarantee that the reading systems will retrieve remotely-hosted resources even if network access is available.