Friday, May 14, 2010

HTML5 Video Works on iBooks on iPad!!

Update, 25 May 2011: I have recently published a new miniguide explaining exactly how to add audio and video files to your EPUB formatted ebooks so that they work properly and look great in iPad, iPhone, and iPod touch, as well as NOOK Color. You can find more information in this article.

This morning as I was going through my overnight email, I saw a notice that "koansin" was now following me on Twitter. I'm not a big Twitter user, and usually I make a cursory look to make sure the follower isn't a spammer, but I don't always follow back. I know this may not be Twitter etiquette, but I use Twitter as a research tool and get easily overwhelmed with too much information.

But, I've been experimenting with Twitter tools that automatically follow people who follow me and I happened to visit koansin's stream. It said an amazing thing:
Video does work in iBooks
I have experimented a fair bit with video on iBooks and hadn't been able to make it work. Who would have thought the solution was to just believe in HTML5 and use the proper format!? And it does work.

Here's what I learned. Here's a direct link to the video on my own site until YouTube finishes processing it.

And here are the highpoints, I promise I'm going to work on improving my screencasting, now that I'll be able to add screencasts to my books!

  1. Begin your html document with this header: <html xmlns="http://www.w3.org/1999/xhtml">. The ePub format requires XHTML 1.1, but iBooks accepts your code even if you use HTML5. 
  2. Where you want your video to appear, begin the video element, by typing <video
  3. The most important attribute is src, which gives the location of your video. The video should be in .m4v format or .3gp format. If your video isn't in one of these formats already, open it in QuickTime, and choose Save for Web, and then choose the desired format. The .m4v format is higher quality and looks beautiful in the iPad. The .3gp format is for cellphones. In this example, I used src="html5video.m4v".
  4. Unless you plan to build the controls for your Video player, you should add controls="true" so that your reader can play, rewind, change the volume, and view the video full screen.
  5. The default proportions for a video object in iBooks appear to be for widescreen. If you have a 4:3 video (say, 640 x 480), you can enter a width and height that are proportionate to your video to avoid having black bars on either side. I use width="320" height="240".
  6. Finally, there seems to be a little bug in the autoplay function. It seems like the default behavior is that movies do not play automatically, which is good. However, I've found that after viewing a book and then adding a new book, the old book's video starts playing on its own, even if you close it!! If you add autoplay="false", that won't happen. I recommend it.
  7. Finish the opening video element with a greater than sign: >.
  8. I haven't tested what happens if the video doesn't work, but theoretically what you insert between the opening and closing video tags is what will appear. YMMV.
  9. Finally, add the closing </video> tag.
Compress your ePub as normal and test. It really works. Here's my ePub with embedded video in case you want to look at it on your own iPad. And here's a picture. Be sure and view it in full screen!
Adding video to iBooks for iPad

The moral of the story? Always follow back on Twitter! Thanks, Koan-Sin Tan. Sometimes you just have to know that something is possible in order to figure out how to do it. I'll continue testing and be sure to let you know what else I find out.

97 comments:

  1. The video on your site shows "this format is not supported" and "this video cannot be played" on a 3GS iPhone.

    But thanks got the info!

    ReplyDelete
  2. Ugh. Thanks for the heads-up. I've been trying to upload it to YouTube all morning, but it's still processing seven hours later. Will try to fix that.

    ReplyDelete
  3. Video updated and works on the iPhone now. Also, fixed Flickr issue with screenshot that wouldn't show. thanks.

    ReplyDelete
  4. Works fine on my iPhone 3GS.

    ReplyDelete
  5. I would argue that this isn't "embedded video," which to me would mean that when you download the book, you can view the book and all embedded components when you're not online. Semantics...

    ReplyDelete
  6. No, no, it is definitely embedded video. I have provided the video so you can see it (since it explains the code itself) but perhaps that makes it confusing.

    To be clear: the ePub contains the video and no online connection is necessary to see the video once the ePub has been downloaded. Something akin to this page (which will only work in Safari, since Firefox doesn't support this video format).

    ReplyDelete
  7. Please be very clear about what you are doing. You are not creating an ePub file. You are hacking your own file format so it works on exactly one preferred display platform. Essentially, you are designing a Web site for IE6.

    ePub needs updating, as the ePub committee is well aware. But what you are doing isn’t permissible in ePub. It may work where you want it to work, but standards-compliant it isn’t.

    ReplyDelete
  8. If your fonts are set larger in iBooks, the video is cut off at the bottom of the page. Can you set a page break in ePub?

    ReplyDelete
  9. thanks for sharing this info, good stuff.

    ReplyDelete
  10. Joe Clark - fI think Liz is very clear about what this is, as her title states it - "HTML5 Video Works on iBooks on iPad"

    Is she claiming anything else about ePub or HTML5?

    ReplyDelete
  11. @Joe. Yup, it's not standards-compliant at all, and I mention that in the video, and perhaps you're right that I should have been more explicit about that in the text as well.

    I have supported standards in all of my books, but I have never been dogmatic. I have preferred sharing knowledge over dictating when it should be used.

    Indeed I've been complaining for some time about ereaders not following ePub standards either--purposely ignoring the XHTML and CSS specs that they're supposed to follow. This is as big a problem as jumping the gun and using HTML5 before it becomes part of the official spec.

    And HTML5 will certainly become part of the ePub spec, the question is when. I can't deny that I'm excited that we can add video to iBooks, and I'm not at all sure I'm willing to wait until the standards catch up. At the very, very least, it's my job to explain how to do it, what the pitfalls are, and when it is more, or less, appropriate. I'm sure others will make their own determinations.

    ReplyDelete
  12. Yes, you can make there be page breaks in ePub, by creating distinct content files. But then you wouldn't be able to wrap text around the video. Trade-offs everywhere!

    ReplyDelete
  13. And for the record, Adobe Digital Editions can also read this file, though it won't show the video. Instead, it shows the alternate text, which can include a link to an external video.

    ReplyDelete
  14. That's pretty darn cool - The ability to wrap up video into a format, that would work with any iPhone/Touch/iPad - to then display rich text, and video...
    Maybe we'll see Apple openly pushing the ePub standard when they get to internationally opening their iBook stores come international launch of iPad.

    ReplyDelete
  15. @Joe

    I don't follow the logic of comparing this to developing a site just for IE6. Won't any epub readers that are not able to parse and render the content in a video tag just simply ignore it?

    ReplyDelete
  16. One more reason to stick to paper books!

    ReplyDelete
  17. @Iljitsch. This example was a little rushed, but I think there is enormous potential for video in technical books (like mine). I often show before and after shots for a given technique and am at pains to point out what changed. Inserting a video instead could make it much more clear.

    Or think about travel books, cooking books (how do you beat those egg whites properly?), farming books (milk a cow?), craft books (knit 2 purl 2?) There are some things that are much more effectively shown than described.

    ReplyDelete
  18. Liz, I don't want to stand in the way of progress, but I'm pretty skeptical. Reading and watching video are two very different things, and I don't think they mix very well. But I guess it's easy for me to say that because the topic of my book doesn't much lend itself to video.

    ReplyDelete
  19. Every ePub should be passed through a validator. Yours will not validate, since it is not valid XHTML 1.1

    ReplyDelete
  20. To respond to Anonymoose: Most claimed viewing applications for ePub suck. I would expect them to accept any form of hacked and mangled “HTML.” But ePub requires XHTML 1.1, which has to be absolutely perfect or rendering must stop dead in its tracks.

    The answer to your question, then, is yes, “any ePub readers that are not able to parse and render the content in a VIDEO tag” will probably not choke. But that’s because they suck as HTML parsers, not because of any feature we want to encourage.

    ReplyDelete
  21. When I was in a Technical Writing class, one of the assignments was to write about how to tie a knot. Just words. Had to be prose, not bulleted list.

    As useful as that can be as an exercise in writing, a video snippet would make much more sense for demonstration and be more digestible in reception. OTOH, writing out the leading and followup paragraphs allow people to skim the information about the subject such as uses for the knot, requirements (thickness, material), and pros/cons. Skimming and speed reading text is more commonly practiced skill than with audio/video, which also suggests audio should be minimized.

    In a way, text flattens the dimension of time required by audio and video. It's like in topography when instead of having to spin a cube in your hands, you splay out the sides into a flattened sheet so you can view all six sides at the same time. Sometimes though, it's helpful to see how a couple of the sides merge such as when there is a design on the surface, and that's when the cube in your hands is preferred.

    Audio can also be helpful with pronunciation of unusual words or names, or demonstrating an accent for a character to help readers mentally add flavor to the written dialogue.

    That's some of the advantages of text combined with the advantages of video/audio. Oddly enough, as common as one would expect this to be on the Internet with it's multimedia capabilities, it just isn't. Perhaps because people focus on a single form instead of combining materials? Seems like a product of our segregational culture, as can be seen in "education" categorizing ideas into subjects.

    Pure text in the beginning was limiting for quick and simple description, and pure flashy content is limiting by impeding quick mastication and digestion. Those aren't opposites, for there are plenty of other factors. The use of both allows the minimization of each leading to smaller and succinct presentation, which further eases the consumption and assimilation of the shared info.

    ReplyDelete
  22. that's great, what about audio files? what is the code to include some in an eBook for Ipad? thank you.

    ReplyDelete
  23. @French Spanish Online: Based on my experimentation, this works just as smoothly as the video. Great for adding songs to my bird books! Just Google "HTML5 audio" and you'll find the syntax.

    ReplyDelete
  24. "ePub requires XHTML 1.1, which has to be absolutely perfect or rendering must stop dead in its tracks." is clearly something that needs to be changed to match actual practice, as HTML5 has.

    ReplyDelete
  25. Liz, great discovery and excellent work. With credits to Koan Sin Tan as well. Never mind the naysayers about standards compliance. The standards will get updated someday.

    I am working on a epub editor and publishing platform and your research is such a wonderful benefit to everyone.

    ReplyDelete
  26. I think in most cases I would just want to read, Liz. But I can see how this kind of functionality could be useful.

    I think I've got an example. I recently came across an interesting article on the aesthetics of music and the ago-old question whether particular types of music have moral significance. Here's the link:

    http://www.american.com/archive/2010/february/soul-music

    Now, that's a webpage that uses Flash videos. If you read that essay in a magazine it would still be interesting, but there's more here. The writer will say things like "You will notice here that the rhythm is generated internally, by the melodic line, and that it is generated by the voice alone ..." But without audio, you *can't* listen for that. I think embedded audio would have done just as well for some of this, but in some cases what's seen is important, too, since music flows into movement and dance and that's also commented on in the text.

    Sure, I don't want sound effects when I'm reading a novel or something like that. But I'm certain there are uses.

    Mike

    ReplyDelete
  27. "...Compress your ePub as normal and test."

    I was wondering about a good method to properly compress an ePub using Mac. I'm not sure about how to control what items get compressed.

    Thank for sharing Liz!

    ReplyDelete
  28. Shawn, use Terminal. Use cd to get to the directory that holds your files. Then type

    zip -0Xq book.epub mimetype

    followed by a return.

    Then type

    zip -Xr9Dq book.epub *

    followed by a return.

    You'll find your book.epub file in the directory.

    There is a one step command, but it sometimes doesn't work for me.

    You can also use

    unzip book.epub

    to look at all the files inside an epub

    ReplyDelete
  29. OK... great, I will give it a try. Thank YOU

    ReplyDelete
  30. I tried your code for inserting video and was delighted to find it worked for me. The video appeared on first text page of the nascent book.
    I then copied the video code exactly into the middle of a 24 page document that was viewable in iBooks. This of course bumped the video to beyond page one.

    And the video wasn't there. Only a blank space where it should have been.

    For what it's worth, the video does show up in Safari and Chrome preview; not in Firefox.

    ReplyDelete
  31. I believe I confirmed the placement problem. I just took it out of the mid-section (where it didn't show up) and put it on the first text page—where it does show up. Only placement changed

    ReplyDelete
  32. Yup, I was just tweeting about this the other day. Video only works in iBooks on the first page of a document. I'm not sure why, and I tried lots and lots of configurations. One workaround is to just create a new document where you want the video to appear.

    ReplyDelete
  33. and what software do you use for you ebooks? I am trying Sigil but it removed the lines of code I add about video or audio files, I save the file and the lines are removed.

    ReplyDelete
  34. I use InDesign to generate the first draft and then clean it up with BBEdit.

    ReplyDelete
  35. Will you soon-to-be-released book on making iBooks include information about setting all the parameters one needs to set in InDesign in order to get the right stuff exported?

    And what is the likelihood that video will work anytime soon. Mine is a book that would profit from integrated video.

    Release date?

    ReplyDelete
  36. Brent, yes, I will include all necessary parameters in book, and also, video works right now, no waiting required.

    Release date: checking now

    ReplyDelete
  37. Hi Liz, thanks for great info. I'm very new to ePub but am trying to embed video in epub file for brochure at work for iPad. I've tried to copy your html code and replace your video with one of ours, but it's not working. Where should the m4v actually be for the src= code? Is BBeEdit the best tool for coding and compressing to ePub? Thanks very much.

    ReplyDelete
  38. The location of the m4v file should match what you use in the src.

    I use BBEdit for coding and zip (in Terminal) to compress to ePub.

    ReplyDelete
  39. Great work LIz! I was just wondering, does the "only work on the first page"-problem occur with the tag?

    ReplyDelete
  40. Liza Dailey has achieved some success with this as reported here: http://blog.threepress.org/2009/11/15/using-html5-video-in-epub/

    BTW, I was able to open your .epub file in Sigil but the video wasn't shown. Neither was the video tag markup.

    ReplyDelete
  41. @flowney, yes, but her test doesn't work on the iPad. And it doesn't validate. I agree it's interesting though.

    Not sure about Sigil. The video element is not standard for XHTML 1.0 (which ePub currently requires) and perhaps Sigil gets rid of it for that reason. You can just unzip my ePub doc with Terminal or Zip and look at it with a text editor.

    ReplyDelete
  42. Hello,

    Thank you for your great work !

    I've managed to insert a video on a epub and read it properly on my ipad but...

    when I want to add another video, let's say 2-3 pages further, i come with a blank space.

    I used the same code as the first one, aka :
    "
    if video tag doesn't work for you, you'll see this line
    "

    My guess is that ibooks, or the epub format isn't able to deal more than one video or that it thinks that it is the same one.

    Maybe we could add some id tag to the code but, I confess, I'm kinda new at this and have no professional knowledge in html.

    Thank you in advance for your answers.

    ReplyDelete
  43. hi, I tried to add 2 m4v videos on the same xhtml page following the example above, and I tested the book on my iPad, I can watch the first video but not the second, there is only a space for the video but white like the background, i dont understand why, any ideas? thank you in advance

    ReplyDelete
  44. Yup, I've noticed that too. Not only can you only show one video per document, it will only appear on the first page of the document. If you try to insert it into the middle of the xhtml doc, and it appears on page 2 or 6 or whatever, it won't appear.

    Solution? Create a new xhtml doc for each video.

    (And/or wait for possible changes in the next version of iBooks :)

    ReplyDelete
  45. thank you for your help, I was thinking about that solution but it seems weird that 2 videos cant be displayed with the same code!!! asi es...

    ReplyDelete
  46. hello I was just wondering liz, what type of software are you using to write the ebook video file? i mean do you use sigil or just any writing editor. I ve tried to use sigil and it like erases what i write on it(<video src...). I dont really have much experience on this area but anything helps out thank you.!

    ReplyDelete
  47. Hi Jose:

    I use BBEdit (on a Mac, from Barebones Software) to write the code in the XHTML file. I've heard good things about Notebook++ (http://notepad-plus.sourceforge.net) if you're on Windows.

    ReplyDelete
  48. Thank you Liz, now one more question!
    What do you use to convert to ePub?

    ReplyDelete
  49. I don't know, but I'd like a step-by-step tutorial for this.
    Could get big!

    ReplyDelete
  50. It's coming. You can preorder here: http://bit.ly/dv7Y6X

    ReplyDelete
  51. ibooks 1.1 breaks the video embed, seems the height is fixed to a specific value and won't resize...

    ReplyDelete
  52. Liz,

    In the discussion above, you indicated that an ePub with embedded video won't pass epubcheck v1.0.5, right?

    If that's true, you cannot get it into the iBookstore since that validation is a requirement.

    So, what's the point? Even if iBooks on the iPad can display that video, you can't sell the book through iBooks. Seems like little more than an interesting exercise with no practical value.

    Walt Shiel

    ReplyDelete
  53. Hi Walt:

    What's the point? HTML5 is almost upon us. HTML5 EPUB books will validate soon, maybe as soon as the fall. Meanwhile, we can experiment, think of the possibilities, and even sell books directly from our own sites. Plus, it's cool :)

    best,
    Liz

    ReplyDelete
  54. OK, Liz. That makes sense. For some reason, I got the impression you were doing this as part of the effort to get books into iBooks...like, now.

    But planning ahead is good, too.

    ReplyDelete
  55. Hi Liz,

    Is this book going to be available on Kindle or iBooks?

    Thanks!

    ReplyDelete
  56. My new EPUB book will be available in print, EPUB, PDF, and Kindle editions.

    ReplyDelete
  57. Oh... Now iBooks with Audio and Video in the new iBooks 1.1.1. It is here. One problem though. If I drag a video in ID 5 it doesn't work in ePub, it does work in previe though. What to do, what to do?

    ReplyDelete
  58. I'm using ID 5 too and trying to get the video to work.

    Seems if I try to place a .m4v or .3gp it just freezes but I think that's because they aren't supported by ID 5. It only supports .mp4 or .flv I believe, there's a full list in Adobe Help.

    I've been trying to use eCub and wondered if anyone has any experience using this?

    ReplyDelete
  59. Just managed to get two videos on two different pages, working in one ePub document on the iPad using eCub.

    We found that we just had to make sure the videos were in the OPS folder and then tested it with the iPad and they both work fine.

    We are using the code in this blog post and not doing anything else.

    I managed to do it with two podcasts from iTunes and just changed the file extension to .m4v. No need to use Quicktime at all and now every time I download a new video it seems iTunes automatically saves them as .m4v.

    ReplyDelete
  60. What about audio?? Can I run just a .wav file in ePub on the iPad? They announced that it can, but didn't provide any help with the code...

    ReplyDelete
  61. Not that easy for audio such as .wav. It works in ibooks, but can't pass for epubcheck 1.0.5.

    Just wondering, "a href" is not suitable for ".wav"? The checker says... it is non standard resource...

    ReplyDelete
  62. Apple no longer requires EpubCheck. See this newer post: http://www.pigsgourdsandwikis.com/2010/08/apple-no-longer-requires-epubcheck.html

    ReplyDelete
  63. concerning the audio.. do I just use simple to place the wave or mp3 file on the ePub?? I've had no luck at all with getting the audio to work.. any help is GREATLY appreciated!

    ReplyDelete
  64. Great article, it was very useful for what I am trying to do (use iBooks to view a PDF with embedded video). Do you know, or have you tried to embed a video inside a PDF file and then view it inside iBooks as you did with the ePub format?

    ReplyDelete
  65. I'm working away on a enhances iBook, featuring video and audio. I have it working how I want on an iPhone and an iPad, but now I want to try and make it available through iBooks, but when I run a test using ePubChecker and others it shows these errors in all audio and video files,

    ERROR: /Users/a_p_brooks/Documents/New Worlds tv.epub/OPS/chapter-30.xhtml(5): unknown element "video" from namespace "http://www.w3.org/1999/xhtml"

    and

    ERROR: /Users/a_p_brooks/Documents/New Worlds tv.epub/OPS/chapter-28.xhtml(5): unknown element "audio" from namespace "http://www.w3.org/1999/xhtml"

    I'm using mp3's as the Audio files and .m4v's as my video files, all put together in Pages.

    If anyone can see what I am doing wrong, because I'm pretty close to cutting my loses and just making it available through my website.

    Thanks for your time.

    Andrew Brooks

    ReplyDelete
  66. @Andrew: Books do not have to pass EpubCheck to get into the iBookstore anymore. See this article: http://www.pigsgourdsandwikis.com/2010/08/apple-no-longer-requires-epubcheck.html and this one: http://www.pigsgourdsandwikis.com/2010/08/publishing-to-apples-ibookstore.html

    If your only "errors" are the video and audio tags, you're good to go.

    ReplyDelete
  67. Great, brilliant, fantastic, they are the only issues raised.

    As a none US person do you have any advice on the best service to use to upload via to get onto iBookstore?

    Also do you know where things are up to with the video format? Does it have to be in .m4v's still, or will quicktime mov's work, as the lack of saving controls in Quicktime means .m4v's are much bigger files.

    Thanks

    ReplyDelete
  68. @Andrew, I have seen iBooks with .mov and with .avi. I've also noticed that the audio encoding (of the video) is important. My still camera creates videos with the wrong audio encoding and they don't work unless converted to .m4v, but my husband's camera (a different type of Canon), creates the same video format but with a different audio encoding, and his movies work in iBooks. I'll post a summary more officially.

    As for getting into the iBookstore, there was a booklet that a friend of mine had published. Let me look for it and I'll post something on that too.

    ReplyDelete
  69. Thanks again Liz, feels like I'm getting closer to making the book available.

    ReplyDelete
  70. Hey Andrew: Here's the link to the guide that my friend Christine wrote on ebook publishing services: http://www.gravityswitch.com/blog/guide-to-comparing-services-for-publishing-ebooks-to-ipad_119/

    ReplyDelete
  71. Hi Liz,
    Just hit another snag, none of the eBook publishing services that I have been in touch with will let an eBook through with http://www.threepress.org/document/epub-validate/ saying that there are errors with the video and audio format, as mentioned in the last few posts. So I'm thinking that people have been getting the non .m4v formats through buy being US based and uploading directly to iTunes connect.

    Not sure what to do next, I guess they are tied into work with apples guidlines even though it looks like they might have changed but not let anyone know. Do you have any thoughts on any way round this, or should I see if one of my American friends wants to form a partnership.

    Thanks,

    Andrew

    ReplyDelete
  72. @Andrew: finding an American partner seems like a reasonable solution. Which are the companies that won't take your EPUBs with audio and video? Perhaps they need more information? (e.g., that Apple now accepts same)

    ReplyDelete
  73. This is really great information. I had been waiting for months for Adobe to release publishing tools to allow rich media creation using InDesign, and when they finally announced it this week, it's way overpriced for an independent producer ($700 per month for using their hosting service plus a per-issue fee...ack!). Your method would allow me to do exactly what I had hoped: simply produce a book with embedded video files that will work on an iPad. I was holding off on buying an iPad until I was sure I could produce this content and get it up for sale on iTunes. Do you have any links to books produced with video using your method that are being sold on iTunes, or through another publisher? I'd just like to make double sure before I plop down the money on an iPad or iPod Touch.

    Thanks,
    John Green

    ReplyDelete
  74. Hi John:
    Glad you found the info helpful. Check out this more current article, complete with link to working example:
    http://www.pigsgourdsandwikis.com/2010/10/first-fiction-ebook-in-ibookstore-with.html

    Let me know if you have any other questions.
    Liz

    ReplyDelete
  75. I purchased your ebook and it looks great; however, I'm concerned about the definition of an "example" video. I really want to make sure that if I produce a series of videos to go along with an Epub book, that it isn't going to get rejected. I wonder if there's a specific documentation of the kind of videos they will and will not accept, or where would I go to find such an explanation?

    ReplyDelete
  76. Hi Liz,
    Ok, getting very close indeed to getting the file onto the iBook store, I have had someone in the US upload it, there were no problems with the enhanced elements, which is great. The only trouble now is that,

    "An Apple requirement is that all the files in the ePub be listed in the OPF file. So, the error was that there was an unmanifested iTunes artwork file."

    Do you know anything about this problem, or a fix, I am working with iWork pages to put this together.

    Thanks again, when I get this live I will send you a print as a thank you for all your help. Could not have done it without you.

    ReplyDelete
  77. Yes, the specific documentation is available from Apple when you sign up with them to sell through the iBookstore. You can find details here: http://www.pigsgourdsandwikis.com/2010/08/apple-no-longer-requires-epubcheck.html

    Nevertheless, as I detail here, Apple's stated requirements are much more detailed than what they really require for acceptance, as you can read in the last link I gave you.

    Hope you like the book!

    ReplyDelete
  78. Andrew:
    When you add files to iTunes, it actually adds a iTunes Metadata file to your EPUB file, and what I'm gathering from the error is that it's now complaining because you didn't declare that file in your OPF file (although it could be talking about some other file that I don't know about). Unless you're using the iTunes Metadata file, I would delete it. Then you should be OK.

    I look forward to seeing it!

    ReplyDelete
  79. Thanks Liz, got it worked out, exported the file from Pages and sent it with out opening it into my iTunes at all, now it's uploaded with all the Media as mentioned above.

    Going to release it next week so I will let you know how to find it.

    ReplyDelete
  80. Congrats, Andrew, and thanks for alerting me to the problem. I knew that iTunes had that effect, but it never occurred to me that Apple would then reject the EPUB because of it. That's pretty ridiculous! Good luck with it!

    ReplyDelete
  81. Thanks for the above information. I also use InDesign CS5 for creating ebooks but after export the files come out as xhtml, not html. When entering your code in BBEdit for the video everything works except the video. Is this because my files are xhtml and not html? If so, how can this be changed. Thanks for any help you can provide.

    ReplyDelete
  82. @David, No, it's not about xhtml vs html. It's more likely the format of the video. Try opening with QuickTime and then saving or exporting for Web and using one of the files it generates. I'd be curious to know more about the video that doesn't work, one of my cameras exports video that works directly, the other doesn't.

    ReplyDelete
  83. Found the problem...the video file was in the wrong location (is was in m4v format). Now everything works fine. I just need to learn how to center the video and all will be well. I just hope iTunes will accept the epub with this new code in it. Thanks again for sharing this information.

    ReplyDelete
  84. @David. That's great! To center, wrap the video in a div and apply text-align: center to it in the CSS. Once iTunes accepts it (they will, they will), send me a link, I'd love to see. Good luck!

    ReplyDelete
  85. Well, your suggestions worked great. Video is centered and looks wonderful on the iPad. Unfortunately, iTunes rejects the files claiming the video file is unmanifested. Perhaps it's because I included it in the "Images" folder. When I run the ePub through ePubChecker I get an error saying that the "video" tag is an unknown element. I'll keep trying.

    ReplyDelete
  86. @David, "unmanifested" probably means you haven't listed it (or listed it properly) in the manifest section of the OCF file. It doesn't matter where it is, as long as it's somewhere in the OEBPS folder and that you reference its location properly in that OCF file.

    Don't worry about the ePubCheck error that says video is unknown. That is one of two errors that Apple won't complain about (the other is the audio element). You should have an error about it not being in the manifest as well.

    ReplyDelete
  87. Added the file to the manifest and everything worked. The epub is now uploaded to iTunes. Just waiting for them to approved it. Thanks again for the helpful information.

    I'm going to test the video to see if it works in other e-reader applications used on the iPad like the Nook and Google Books apps, both of which use the epub format?

    ReplyDelete
  88. Does any one have more details about how to process "Children's Picture Books" for iBookStore

    ReplyDelete
  89. I unzipped an epub I made with InDesign (CS5), and simply tried to repackage the files; however, the epub it creates doesn't show anything when it opens in Adobe Digital Editions.

    Am I doing something wrong? I'm trying to package the mimetype, OEBPS folder, and META-INF folder (in that order) that came from the unzipped InDesign epub...

    I'm ultimately trying to add audio or video, but I can't see if it functions without packaging it into an epub! Any help would be greatly appreciated!

    ReplyDelete
  90. Did you follow the instructions in my book for rezipping?

    zip -0Xq file.epub mimetype
    zip -Xr9Dq file.epub *

    Second line for Mac to keep out DS_Store invisible files:
    zip -Xr9Dq file.epub * -x *.DS_Store

    I'd also try running epubcheck to see if it can find the problem. I copied an epub from my iPad last night and somehow the container.xml file had gotten corrupted, and even a properly zipped epub wouldn't work at all.

    Also note that Adobe Digital Editions doesn't support very much (certainly not audio and video), though it should at least show the text!

    Hope that's helpful.

    ReplyDelete
  91. I think I was running into a corrupted xml file as well. I exported a new version to dismantle and repackage, and your instructions worked great!

    Thanks for the help! :)

    ReplyDelete
  92. Well, I had it all repackaged, and it worked beautifully in ADE, but I tried to drag it into iTunes, and nothing happens. (Other than it adding metadata to the file)

    I feel like I MUST be missing something. Even when I directly export to epub from InDesign, iTunes won't give it the time of day. And I'm only using text and images so far! (but very eager to get to video!)

    Sorry to bloat your blog, but nobody else seems to be having this issue, and I'm rather jealous that everyone else gets to play with video! Any suggestions? Thank you graciously.

    ReplyDelete
  93. Hi there - it would appear from your blog that you have succeeded to combine Indesign with movie to export to epub, to create a multimedia ebook. I have designed and created many books and several ebooks using Indesign and exported as both epub and pdfs for the ipad but came unstuck when I needed to add m4v. The method you use to produce a book with embedded video files that will work on an iPad is brilliant. However I am no programmer so what programme do I use to create html5 code in and how to I then combine that with the Indesign file. For me this is a bit of a mystery. Do you have any video tutorials or online instructions that I could follow which would explain this part of the process. Thank you for you help.

    Jane Messore

    ReplyDelete

More of my books