|

Interactivity in EPUB using JavaScript, HTML5 and CSS3: BEA/IDPF video posted

I re-recorded my talk at IDPF Digital Book as a video. Getting the audio synced properly was no fun so I apologize for a few production issues.

Here’s the executive summary of the talk:

I’ll also be posting some of the example files used in the tutorial in a forthcoming post.

|

22 Responses to Interactivity in EPUB using JavaScript, HTML5 and CSS3: BEA/IDPF video posted

  1. Pingback: Interactivity in EPUB by Liza Daly | The Digital Reader

  2. Nate says:

    Liza,

    Have you tried the improved Epub with calibre? I’d bet that all the features will work.

    I’ll try it if you want. Send me an email.

  3. bowerbird says:

    you said:
    > now, in the current version of .epub — .epub 2.0.1. —
    > the specification says that,
    > while the script element is valid,
    > and can be included in .epub books,
    > reading systems *should*not* execute it.
    > now that’s a very technical “should not”. that means…
    > it’s different from meaning “can not”.
    > they’re discouraged from doing so, but they’re not prohibited.

    actually, i believe it means that, although they are not prohibited,
    they’re strongly discouraged from doing so. it’s a question of focus.

    > and the specific language here _may_ change
    > in the next revision of .epub,
    > to make script support less frowned-upon.
    > but that will have to be determined
    > by the working group, in the coming months.

    has the working group committed to a time-frame
    for making this decision? because otherwise it
    might take _years_ for them to act, not _months_,
    as you state.

    and could you address the concerns about security?
    allowing script support might well open the door
    for a whole host of nasty attacks by the black hats.

    -bowerbird

  4. Liza Daly says:

    The Working Group is meeting in person for two days in two weeks. At that point it will be more clear what the pace is going to be, but the next revision of EPUB is scheduled for essentially 1 year from now, so no, it won’t be multiple years.

    As for security, browsers already do a good job of managing JavaScript but I’d look to the activity around HTML5 and @sandbox: http://blog.whatwg.org/whats-next-in-html-episode-2-sandbox for specific details on the issues involved with importing foreign scripting.

  5. bowerbird says:

    liza said:
    > but the next revision of EPUB is scheduled for essentially
    > 1 year from now, so no, it won’t be multiple years.

    thanks for that information.

    so even if the working group approved the change next week,
    it won’t formally become part of the spec until a year from now?

    and even then, some viewer-programs might not support it
    right away? and some might not support it at all, especially
    if it’s not actually _required_ by the spec?

    -bowerbird

  6. Liza Daly says:

    > so even if the working group approved the change next week,
    > it won’t formally become part of the spec until a year from now?

    Correct, though the change is purely a linguistic one rather than (say) adding support for the HTML5 video element. There’s no reason for reading systems to wait until next year to support something that’s already not explicitly prohibited.

    It’s unlikely to be a requirement that reading systems support scripting in any case; I’d just like to see the language changed to something like MAY rather than SHOULD NOT.

  7. Joseph says:

    Really interesting talk, Liza. Completely chuffed to see Monocle used in the video, thanks!

    You know I take a different view of this stuff — in fact, in the development branch of Monocle on GitHub, script tags are stripped from the source. For us, this stuff is still in flux as we try to figure out how to do safe and fast embedding within the domain security model of browsers. Even without the possibility of books containing scripted behaviours, that’s a pretty thorny question. So the security question you mention as a ‘missing piece’: I would underline it, twice, with a red pen (although I must admit I’d scarcely considered it until Keith asked me about it in March — I’d always planned to strip scripts). I have read the various propositions regarding sandboxes and I can’t see any of them as a solution for this; I think they’re intended for another purpose entirely. And an implementation of any of them seems like it’s years off.

    The other missing piece, which for me is probably more significant, is how ‘interactivity’ in epubs affects the interaction model of the reader. Both Ibis Reader and Monocle expect a pointing device or touchscreen, but that’s not the case for many readers. And even then, object-based Flash movies aren’t always clickable in Monocle right now, because a ‘contact event’ will usually turn the page. To get around this, iBooks makes only the margin a page-turning interface, but while that’s suitable for a large iPad screen, it’s not ideal for a small mobile screen. I worry that ceding too much interactive freedom to the book will make it harder for the reading system to have a really awesome interaction model, and right now most reading system interfaces are unfriendly enough.

    Anyway, it’s all quite thought-provoking; I have much more to say, but perhaps I will formalise my thoughts a little first.

  8. Pingback: Geo-aware ebook demo : Threepress Consulting blog

  9. ramesh says:

    hi Liza
    Thanks for the great demo. videos are playing fine on ipad we are having problems with java scripts could please mial or post an example of epub with java script.

  10. Pingback: 1984 comes around again: now your ebook knows your location | The Digital Reader

  11. Pingback: eBook Formatting Standards: What do we want from books? « Words and Things

  12. Ben says:

    You mentioned epub 2.0.1 a lot, and I’m pretty sure the maintenance group was supposed to finish in April. Has epub officially been updated to 2.0.1 yet? I haven’t seen any indication of that on the IDPF website (which is terrible, by the way). Thanks.

  13. Liza Daly says:

    EPUB 2.0.1 was finished on schedule and no it has not been posted on the site yet (in part because the site itself is undergoing a major revision).

  14. Ben says:

    I see. Thanks a lot Liza.

  15. Jose Bermudez says:

    Hi Liza
    I have some questions about videos that could play good on the iPad.
    What frame rate is the best ? Can I shoot HD and will that show on the device?
    File format, does it have to be m4v?
    What are my limits ?
    and… What ePub editor is the best to deal with embedding the video
    thank you

  16. Liza Daly says:

    Jose, at this time there are no published specifications for video in iBooks as it’s not officially supported.

  17. Martin says:

    Hi Liza,

    Great blog and info. Thanks to your example and a little editing in Adobe’s PDFXML I have managed to get our on-line magazine running as an e-book, complete with the videos we normally incorporate.

    I’m reading it on my Ipod using iBooks. When the video plays, if I turn the Ipod through 90 degrees, iBook reverts to showing the magazine page after the video, rather than rotating the video player and showing the moving image. The iPod continues to play the actual video, but there appears to be no way of getting it back on the screen with the controls.

    Regarding Jose’s question. The Ipod and the Ipad have technical specifications for their video, as long as you honour these specifications then videos will play if you incorporate them using the method you describe.

    For the iPod they can be found here.
    http://www.apple.com/ipodtouch/specs.html

    For the iPad, they can be found here.
    http://www.apple.com/ipad/specs/

    Thanks
    Martin

  18. Liza Daly says:

    Thanks for the info, Martin — that’s interesting.

    Apple has included a lot of features in iBooks (either intentionally or just as a consequence of using WebKit) that aren’t 100% there — video, audio, and interactivity are still at a sort-of-working state.

    I’m glad that people are trying to use them and posting their results, since that’s a signal to Apple that these are valuable features. On the other hand, I don’t want anyone going nuts trying to find edge cases that do work reliably, since I’m sure these features are going to evolve rapidly.

  19. Pingback: Reading about ePub interactivity « Matt Jukes

  20. Pingback: Heading down the ePub « KORD!

  21. Pingback: ePub Files: A Look Under the Hood « Pixels and Ink

  22. Stuart Rackham says:

    The question of JavaScript in EPUB is about vendor DRM and control
    rather than any perceived security issues e.g. vendors don’t really
    want you loading scripts to disable the inevitable advertising popups.
    If you want to create interactive books then sooner or later you
    require programmability — JavaScript is the obvious choice, it’s been
    specifically designed to work safely with web pages. We need to move
    away from proprietary readers, the sooner web browser vendors cotton on
    to EPUB and start shipping a native ‘eBook Reader Mode’ the better.