silviapfeiffer1 at gmail.com
Sat Oct 14 00:46:58 PDT 2017
It seems to me that the TextTrack API is made for this use case.
Why does it not work for you?
On Sat, Oct 14, 2017 at 4:36 PM, Michael A. Peters
<mpeters at domblogger.net> wrote:
> This is problematic when dealing with WebVTT which does not require tags be
> Where it is the biggest problem is when the document is being served as
> I tried the following hack which seemed to be working:
> cleandoc = document.implementation.createHTMLDocument("FuBar");
> cleanbody = document.createElementNS("http://www.w3.org/1999/xhtml",
> Then I could do the following when with a WebVTT cue:
> cleanbody.innerHTML = string;
> return (cleanbody.innerHTML);
> That *mostly* works but seems to sometimes fail when string contains
> entities, such as
> What happens is it returns an empty string.
> Given that WebVTT is part of HTML5 and browser native html5 audio players
> don't support caption tracks forcing us to write our own implementations if
> we want captions with audio, it sure would be nice if there was a pure
> guarantee valid WebVTT cue has closed tags which are required for XHTML sent
> as XML.
> Seems to me that a JS native function to add missing closing tags would have
> more application than just WebVTT cues.
> I looked for a jQuery filter that does it, but could not find one.
> It also could be of benefit in emulating document.write() as many of
> Google's tools *still* require document.write() despite the issues with
> document.write() and XML having been known for 15+ years now.
> capable of closing open tags in a string passed to it?
More information about the whatwg