[Media Overlays] EPUB 3.0.1 feature: playback-active-class

138 views
Skip to first unread message

Daniel Weck

unread,
Sep 27, 2013, 5:38:26 AM9/27/13
to Readium Contrib, epub-testsu...@googlegroups.com
Hello all,
(cross-posting to epub-testsuite)

The 3.0.1 revision of EPUB3 supports the new "media:playback-active-class" OPF package metadata (in addition to "media:active-class").

See:

https://epub-revision.googlecode.com/svn/trunk/build/301/spec/epub30-mediaoverlays.html#sec-docs-assoc-style

( http://code.google.com/p/epub-revision/issues/detail?id=305 )

I implemented native support in the Readium-SDK, and tested playback behaviour in LauncherOSX. It would be good if this was in the testsuite as well.

This effectively produces the same results as iBooks' proprietary "-ibooks-media-overlay-enabled" CSS class, except that the standardised EPUB3 feature allows authors to pick any class name they wish (instead of having to stick to a predefined one). The class name gets injected into the HTML document element at playback time, and removed when paused/stopped.

To support both Readium and iBooks (until iBooks makes use of the standardised EPUB3 feature), authors can use the following CSS selectors in their stylesheet:

HTML:
<span id="state">playback status</span>

CSS:
html.-ibooks-media-overlay-enabled #state,
html.-epub-media-overlay-playing #state
{
background-color: green;
}

OPF:
<meta property="media:playback-active-class">-epub-media-overlay-playing</meta>

...and just as a reminder, this is how to highlight the currently-spoken phrase (iBooks implements the EPUB3 standard):

CSS:
.-epub-media-overlay-active
{
background-color: yellow;
color: black !important;
}

OPF:
<meta property="media:active-class">-epub-media-overlay-active</meta>


Regards, Daniel

Ori Idan

unread,
Sep 27, 2013, 5:51:00 AM9/27/13
to epub-testsu...@googlegroups.com, Readium Contrib
I'd appreciate it if someone can write such a test.
If possible fork the epub-testsuite and I I will later merge the result.
If you don't know how to do it, me or Markus can merge it.

-- 
Ori Idan



--
You received this message because you are subscribed to the Google Groups "epub-testsuite-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to epub-testsuite-di...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Daniel Weck

unread,
Sep 27, 2013, 5:59:31 AM9/27/13
to epub-testsu...@googlegroups.com, Readium Contrib
Although I do not have the bandwidth right now, I would love to learn how to write a test in the testsuite framework. Could you please point me to a step-by-step guide, or to a concrete example that demonstrates how to implement failure / success assertions? Many thanks! Dan

Ori Idan

unread,
Sep 27, 2013, 6:31:03 AM9/27/13
to epub-testsu...@googlegroups.com, Readium Contrib
On Fri, Sep 27, 2013 at 12:59 PM, Daniel Weck <danie...@gmail.com> wrote:
Although I do not have the bandwidth right now, I would love to learn how to write a test in the testsuite framework. Could you please point me to a step-by-step guide, or to a concrete example that demonstrates how to implement failure / success assertions? Many thanks! Dan

Markus has done a great job explaining it in the readme file of the test-suite
Also look at the sources of all tests, you will see there several media-overlay tests already done by Marisa DeMeglio

--
Ori Idan
Reply all
Reply to author
Forward
0 new messages