Whitespace in TTML subtitles is rendered literally although xml:space="default" #665
Labels
flag: good first issue
This might be a relatively easy issue; good for new contributors
status: archived
Archived and locked; will not be updated
type: enhancement
New feature or request
One of the standard assets for testing subtitles on dash.js is
http://vm2.dashif.org/dash/vod/testpic_2s/xml_subs.mpd
It uses white-space surrounding
<span>
elements in<p>
elements and this white-space is rendered literally in shaka-player, although it should not, since the xml:space="default" is specified.The TTML 1.0 spec Section 7.2.3 says that for xml:space="default", white-space should be treated like
suppress-at-line-break="auto"
linefeed-treatment="treat-as-space"
white-space-collapse="true"
white-space-treatment="ignore-if-surrounding-linefeed"
I made an alternative version of the stream above with suppressed white-space
http://vm2.dashif.org/dash/vod/testpic_2s/xml_subs_no_ws.mpd
which shows how it should look like in Shaka-player.
There are also colors and EBU-TT padding in this example, which dash.js can render, but Shaka-player ignores. That is an acceptable behavior, since no hiccup occurs.
It may be too much work to implement both xml:space="default" and xml:space="preserve", but at least the default mode should be implemented. Currently, the rendering rather follows xml:space="preserve".
I made a small fix for empty subtitles #646 in PR #650, but should have taken a bigger grip to get white space ignored generally as the default.
I may give a shot at a PR, but in that case only for xml:space="default". What is the best way forward?
Environment
What version of Shaka Player are you using?
2.04
Can you reproduce the issue with our latest release version?
Yes
Can you reproduce the issue with the latest code from
master
?Yes
Are you using the demo app or your own custom app?
demo
What browser and OS are you using?
Chrome on Mac OS Sierra
The text was updated successfully, but these errors were encountered: