Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional empty transparent region when playing STPP/TTML subtitles in Chrome #4429

Open
tobbee opened this issue Mar 20, 2024 · 8 comments

Comments

@tobbee
Copy link
Contributor

tobbee commented Mar 20, 2024

Environment
Steps to reproduce
  1. Just play the URL
Observed behavior

Synchronised with the TTML subtitles, there is a wide transparent region with rounded corners at the bottom of
the image. This shadow is not present when playing in Safari.

The region is similar to the subtitle region when playing subtitles using wvtt:
https://livesim2.dashif.org/livesim2/timesubswvtt_de/testpic_2s/Manifest.mpd


Screenshot 2024-03-19 at 18 45 38

@tobbee tobbee added the Bug label Mar 20, 2024
@nigelmegitt
Copy link
Contributor

nigelmegitt commented Mar 20, 2024

Reproduced in Chrome, bug not present in Firefox.

In Chrome, inspecting the elements, the unwanted area is not part of the DOM tree associated with the rendered TTML captions; it's not actually inspectable at all. I suspect the browser is attempting to render the VTTCue in the shadow DOM, that's intended to be used only for timing purposes to render the TTML. I'm not sure if there's a Chrome-specific way to prevent this: on my system (MacOS 14.3.1) the Chrome settings for captions takes the user to the System Preferences for Captions, but that shouldn't really be relevant - the browser shouldn't be attempting to render these VTTCues at all, so the question is why it is doing so and if it can be prevented.

@tobbee
Copy link
Contributor Author

tobbee commented Mar 22, 2024

@nigelmegitt Do you think this is a bug in Chrome, that should be reported there?

@nigelmegitt
Copy link
Contributor

@tobbee probably, yes.

@dsilhavy
Copy link
Collaborator

I think we discussed this before at some point and there was a CSS based solution to disable the background. I tried something like this for testing but didnt work:

::cue {
    background: blue;
}

@bbert Do you remember what we did to disable this grey background in Chrome?

In any case, as @nigelmegitt pointed out we are using TextTrack to handle the timing for the custom rendering. I would like to move to custom handling completely like we did here: https://reference.dashif.org/dash.js/nightly/samples/captioning/vttjs.html. This should also solve this issue then.

@bbert
Copy link
Contributor

bbert commented Mar 26, 2024

I think we discussed this before at some point and there was a CSS based solution to disable the background. I tried something like this for testing but didnt work:

::cue {
    background: blue;
}

@bbert Do you remember what we did to disable this grey background in Chrome?

In any case, as @nigelmegitt pointed out we are using TextTrack to handle the timing for the custom rendering. I would like to move to custom handling completely like we did here: https://reference.dashif.org/dash.js/nightly/samples/captioning/vttjs.html. This should also solve this issue then.

@jeffcunat I think you're the one who found this trick to disable the grey background, do you remember? you're still my css expert...

@jeffcunat
Copy link
Contributor

Hi @bbert, as far as I remember it is some vendor specific pseudo class like those mentioned here : video::-webkit-media-text-track-region

https://chromium.googlesource.com/chromium/blink/+/72fef91ac1ef679207f51def8133b336a6f6588f/Source/core/css/mediaControls.css?autodive=0%2F%2F%2F#343

@jeffcunat
Copy link
Contributor

I think we discussed this before at some point and there was a CSS based solution to disable the background. I tried something like this for testing but didnt work:

::cue {
    background: blue;
}

@bbert Do you remember what we did to disable this grey background in Chrome?
In any case, as @nigelmegitt pointed out we are using TextTrack to handle the timing for the custom rendering. I would like to move to custom handling completely like we did here: https://reference.dashif.org/dash.js/nightly/samples/captioning/vttjs.html. This should also solve this issue then.

@jeffcunat I think you're the one who found this trick to disable the grey background, do you remember? you're still my css expert...

To see the actual pseudo elements that the browser uses you can activate the Developer Tools preference on Elements => Show user agent shadow DOM

@dsilhavy
Copy link
Collaborator

dsilhavy commented Apr 3, 2024

@jeffcunat Thanks for your input.
I tried changing video::-webkit-media-text-track-display which seems to be the right element, however it was still showing this gray background. I don't consider this a dash.js issue, but it would be nice if we can document a CSS based solution for this in this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants