View Single Post
Old 10-02-2014, 07:48 PM   #23
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by Psymon View Post
Just as an experiment, I thought I'd add an audio (MP3) file to my ebook, to see if it would work, following Liz Castro's tutorial on how to do it (I even sprung a whopping $5 on her book about adding audio/video). Apparently audio and video only currently work in iPads and Nooks, but I can certainly attest that they do indeed work no problem in the former (I don't have a Nook, but I'll take her word for it).

The only problem is that adding in the <audio> tag gives my perfectly-valid ebook an error (or series of errors) related to that tag.
I think it might be possible in EPUB 2, but you're not going to like what you have to do. Take a look at this part of the spec:

2.3.1.2: Items That Are Out-Of-Line XML Islands


You can implement it like this:
  1. Include two copies of the chapter—one copy with the audio tags specified as XHTML5 content, with media type text/html, and one without those tags, with the usual XHTML 1.1 media type.
  2. In your OPF file, add an entry for both.
  3. In the item entry for the HTML5 version, use the id attribute value from the XHTML version's item in the fallback attribute.
  4. Set the required-namespace attribute to "http://www.w3.org/1999/xhtml".

With that change, you'll get warnings from the validator instead of errors. With that said, I have no idea whether real-world readers will use the HTML5 version or skip it and use the fallback.

You might also have better luck if you specify an empty CSS file in the fallback-style attribute.
dgatwood is offline   Reply With Quote