RESOLVED INVALID 57803
Work-in-progress on rendering TextTracks on HTML5 Video
https://bugs.webkit.org/show_bug.cgi?id=57803
Summary Work-in-progress on rendering TextTracks on HTML5 Video
Anna Cavender
Reported 2011-04-04 16:21:05 PDT
This bug is just to share code with dglazkov, will remove after discussion.
Attachments
Patch (176.06 KB, patch)
2011-04-04 16:47 PDT, Anna Cavender
annacc: review-
Anna Cavender
Comment 1 2011-04-04 16:47:43 PDT
Anna Cavender
Comment 2 2011-04-04 16:50:12 PDT
dglazkov, sorry for such a huge patch, I hope you can skip to the relevant stuff! thank you sooooooo much for taking a look and let me know if you have any questions.
Roland Steiner
Comment 3 2011-04-04 19:56:22 PDT
is it possible to extract the VTT and Cue parsers into their own separate stand-alone patch(es) to reduce the overall patch size?.
Dimitri Glazkov (Google)
Comment 4 2011-04-04 21:06:56 PDT
No worries. I realize this is a snapshot of your checkout :) I read up on <track> element and now realize that this is the same use case as the <details>/<summary> element (http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#the-details-element) The approach you are currently taking (and the one I misled you toward) is workable, but ultimately is drenched with angel tears and droplets of unicorn blood. The problem here is that the <track> element itself is just data -- it's appearance is projecte onto the visual surface of the video element via MediaControlTextTrackElement. This means we have to manage lifetimes and lifecycles of both of these and synchronize them, and surely suffer through mysterious crashes and bugs all around. Instead, we should take this approach: 1) Fix bug 56973, which would allow us to place <track> element's render object inside of the RenderVideo hierarchy 2) Implement <track> element as a box (probably a RenderBlock subclass), which displays just the right text inside of it. 3) Profit on a horse. We are sprinting toward fixing bug 56973, so that we can get this done soon. Can you guys try to land other bits of the track stuff first and hang tight on implementing the visual parts of <track>? We promise to help with advice/code/reviews. WDYT?
Anna Cavender
Comment 5 2011-04-04 21:18:40 PDT
I think that sounds like a fine plan! Thanks again for helping out. I'm very relieved: I was starting to worry about all of those creates and removes going on in there :). Believe me, we have plenty of other things to work on while you work on a new design. Keep me in the loop. And again, THANKS!
Anna Cavender
Comment 6 2011-04-05 12:13:16 PDT
Quick question about creating a RenderTrack as a RenderBlock subclass and attaching to the RenderVideo hierarchy. I think that will work fine for <track> as a RenderTrack can be associated with each HTMlTrackElement. But, how would this work for in-band tracks that will be demuxed from MediaPlayer? They will have no associated DOM element, so can HTMLMediaElement somehow manage them and attach them to the RenderVideo heirarchy? Not quite clear how that will work?
Dimitri Glazkov (Google)
Comment 7 2011-04-05 12:58:02 PDT
(In reply to comment #6) > Quick question about creating a RenderTrack as a RenderBlock subclass and attaching to the RenderVideo hierarchy. I think that will work fine for <track> as a RenderTrack can be associated with each HTMlTrackElement. But, how would this work for in-band tracks that will be demuxed from MediaPlayer? They will have no associated DOM element, so can HTMLMediaElement somehow manage them and attach them to the RenderVideo heirarchy? Not quite clear how that will work? Can we model this as adding a <track> element _in_ the shadow DOM, so that the script can't see it?
Anna Cavender
Comment 8 2011-04-05 14:42:52 PDT
What do you think about creating a RenderCue instead of a RenderTrack? That way it will have a guaranteed 1:1 relationship with a TextTrackCue. I.e., a <track> could have multiple cues showing at a time and so it would have to manage an unknown number of RenderTracks, which might be fine but seems sort of complicated.
Dimitri Glazkov (Google)
Comment 9 2011-04-05 20:47:55 PDT
(In reply to comment #8) > What do you think about creating a RenderCue instead of a RenderTrack? That way it will have a guaranteed 1:1 relationship with a TextTrackCue. I.e., a <track> could have multiple cues showing at a time and so it would have to manage an unknown number of RenderTracks, which might be fine but seems sort of complicated. Good question. Ideally, I want to avoid creating new custom RenderFoos altogether. <track> should just use RenderBlock, and the logic of putting the cue in it should be built into the track element.
Note You need to log in before you can comment on or make changes to this bug.