HTML5 video with WebVTT native captions that start at 0:00:00.000 show the first native caption even if it is 'hidden'.

RESOLVED INVALID

Status

()

RESOLVED INVALID
2 years ago
2 years ago

People

(Reporter: dave.theroux, Unassigned)

Tracking

51 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20170125094131

Steps to reproduce:

Using Firefox 51.0.1 with HTML5 video and native WebVTT caption files that start with the first caption time stamp of '0:00:00.000'. 


Actual results:

The first native caption is displayed even though the track mode is set to 'hidden'. Once the first caption item is complete the native captions are properly hidden.


Expected results:

No native caption should display if the mode is set to 'hidden'.
(Reporter)

Updated

2 years ago
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64

Updated

2 years ago
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
hmm, I can not reproduce it at my nightly.
Maybe bug 1329117 fixed it?
Flags: needinfo?(ralin)
See Also: → bug 1329117

Comment 2

2 years ago
As bug 1329117 is flagged as WONTFIX in 51, we can find out the answer by comparing 51 and 52. 

Dave, could you provide us a screenshot or a testcase? Since I could not reproduce the results either. Thanks.
Flags: needinfo?(ralin) → needinfo?(dave.theroux)
(Reporter)

Comment 3

2 years ago
I think I have found what the issue is. It appears to be the use of the 'default' attribute for the track. Our video content normally has a single WebVTT track associated with it and that track is set as the 'default' as well as hidden. If I remove the 'default' attribute the issue goes away. I have created a sample that reproduces the issue. When I run it with the track set as the default but hidden the caption is displayed and CC button is shown in the incorrect state.  The code is based on the example on GitHub here:  https://github.com/iandevlin/iandevlin.github.io/tree/master/mdn/video-player-with-captions

I replaced the top level index page with the following in order to better resemble the code we are using.

<!DOCTYPE html>
<html lang="en-IE">
<head>
	<meta charset="utf-8" />
	<title>Video Player with Subtitles - Mozilla</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="stylesheet" href="css/styles.css" />

    <script>
        function loadVideo() {
            var vid = document.getElementById('video');
            vid.preload="metadata";
            vid.controls = "true";
            vid.src = "video/sintel-short.mp4";

            var trck = document.createElement("TRACK");
            vid.appendChild(trck);
            trck.src = "subtitles/vtt/sintel-en.vtt";
            trck.label = "English";
            trck.kind = "captions";
            trck.srclang = "en";
            trck.default = true;
            trck.mode= 'hidden';

            setTimeout(function() {vid.load(); vid.play();}, 100);
        }
    </script>
</head>
<body onload="loadVideo();">
	<h1>Sintel</h1>
	<figure id="videoContainer" data-fullscreen="false">
		<video id="video"></video>
		<figcaption>
			&copy; copyright Blender Foundation | <a href="http://www.sintel.org">www.sintel.org</a>
		</figcaption>
	</figure>
</body>
</html>

Thanks for reviewing.
Flags: needinfo?(dave.theroux)

Comment 4

2 years ago
(In reply to dave.theroux from comment #3)

Sorry for the late reply.

I've created a test page based on your code on https://people-mozilla.org/~ralin/1339582/, and the issue is reproducible now.

----
Hi bechen,

It is likely a problem how we deal with a "default" but "hidden" track. Could you help to look at this issue?
Flags: needinfo?(bechen)
Assignee: nobody → bechen
Flags: needinfo?(bechen)
(In reply to Ray Lin[:ralin] from comment #4)
> (In reply to dave.theroux from comment #3)
> 
> Sorry for the late reply.
> 
> I've created a test page based on your code on
> https://people-mozilla.org/~ralin/1339582/, and the issue is reproducible
> now.
> 
> ----
> Hi bechen,
> 
> It is likely a problem how we deal with a "default" but "hidden" track.
> Could you help to look at this issue?

Ah ha, the HTMLTrackElement doesn't have mode attribute.
Mode attribute belongs to TextTrack object.
Assignee: bechen → nobody
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.