Bug 135159 - Toggling video subtitle display does not restore previous track mode
Summary: Toggling video subtitle display does not restore previous track mode
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Minor
Assignee: Nobody
URL: http://acdha.github.io/html5-media-sy...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-22 09:23 PDT by Chris Adams
Modified: 2014-07-24 05:09 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Adams 2014-07-22 09:23:17 PDT
http://acdha.github.io/html5-media-synchronized-subtitles/demo.html is a simple experiment using the cuechange event to display a text transcript synchronized with video playback.

When the video first plays, the transcript below should scroll and be highlighted as the movie progresses. If you use the standard controls to enable subtitles, both the transcript and subtitles will display normally. If you then use the same control to disable subtitle display, the subtitles stop and the browser will stop sending cuechange events. Re-enabling subtitles (e.g. in Safari on OS X using "Subtitles" but not "Auto") will cause the cuechange events to start firing again.
Comment 1 Chris Adams 2014-07-22 09:35:01 PDT
The easiest way to fix this would be changing the subtitle logic to restore the previous text track mode (i.e. "hidden") rather than setting it to "disabled".
Comment 2 Chris Adams 2014-07-22 11:04:59 PDT
Updated title to reflect that this is really a combination of the default UI and that track mode changes do not trigger an event.
Comment 3 Eric Carlson 2014-07-22 19:32:19 PDT
You can listen for a 'change' event and set the track mode yourself.
Comment 4 Chris Adams 2014-07-22 19:53:54 PDT
(In reply to comment #3)
> You can listen for a 'change' event and set the track mode yourself.

I tried that this morning but never received a change event. I'll make a smaller test case.
Comment 5 Chris Adams 2014-07-23 12:51:17 PDT
(In reply to comment #3)
> You can listen for a 'change' event and set the track mode yourself.

Here's a testcase I tossed together:

http://chris.improbable.org/experiments/browser/video/track-change-events.html

This registers a change listener on video, source and track elements, the video element's textTracks property, and the track element's track property, but doesn't receive an event from changes originated in either the UI or by updating the track's mode directly.

(Interestingly, it also shows a behaviour which only happens in WebKit but not IE11 where change the track element's src attribute causes the active cue to display multiple times even though there is still only one track element on the page)
Comment 6 Chris Adams 2014-07-23 13:01:56 PDT
(In reply to comment #5)
> This registers a change listener on video, source and track elements, the video element's textTracks property, and the track element's track property, but doesn't receive an event from changes originated in either the UI or by updating the track's mode directly.

A quick test in Firefox 31 shows change messages being delivered to the TextTrackList as described by the spec:

http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content.html#handler-texttracklist-onchange
Comment 7 Chris Adams 2014-07-23 13:19:45 PDT
My apologies, after updating my local WebKit nightly the problem was indeed fixed at some point after Safari 7.0.5.
Comment 8 Eric Carlson 2014-07-24 05:09:53 PDT
(In reply to comment #7)
> My apologies, after updating my local WebKit nightly the problem was indeed fixed at some point after Safari 7.0.5.

Thank you for taking the time to diagnose this!