If you really want to use JavaScript for that, try what Liza Daly suggested --- bearing in mind that your EPUB 3 eBook will probably work now only on iBooks (maybe Readium and Kobo app).
If your only purpose is to "select" the video, why don't you simply generate one XHTML page for each video and point your links from the playlist to them? 140 is not a big "number" of elements to be added to the manifest, after all.
Alternatively, you can create a single XHTML page, say videoplayer.xhtml
, using div
s (with associated CSS properties page-break-after
, page-break-before
) like this:
<div class="videoplayer" id="video001">
<video src="video001.mp4" ... />
</div>
<div class="videoplayer" id="video002">
<video src="video002.mp4" ... />
</div>
...
<div class="videoplayer" id="video140">
<video src="video140.mp4" ... />
</div>
so that your playlist will link to videoplayer.xhtml#video001
, etc. Not using JavaScript, you have better chances it will work on multiple devices.