Closed FakeSkdr closed 2 years ago
Good questions. This is what an independent TTML implementation thinks should happen:
And I agree with the sentiment.
We'll take a look. Thanks!
PR #4407 fixed native browser rendering, but not the DOM-based rendering of our UI. Reopening.
Here's the quick repro in JS console of the demo app:
data = shaka.util.StringUtils.toUTF8(`<tt xmlns="http://www.w3.org/ns/ttml" xmlns:ttm="http://www.w3.org/ns/ttml#metadata" xmlns:ttp="http://www.w3.org/ns/ttml#parameter" xmlns:tts="http://www.w3.org/ns/ttml#styling" xmlns:ebuttm="urn:ebu:tt:metadata" xmlns:ebutts="urn:ebu:tt:style" xml:lang="fr" xml:space="default" ttp:cellResolution="50 30" ttp:timeBase="media">
<head>
<metadata><ttm:title></ttm:title><ttm:desc></ttm:desc><ttm:copyright></ttm:copyright></metadata>
<styling>
<style xml:id="WhiteOnBlack" tts:backgroundColor="#00000080" tts:color="#ffffffff" />
<style xml:id="defaultStyle" tts:backgroundColor="#00000000" tts:color="#ffffffff" tts:fontFamily="monospaceSansSerif" tts:fontSize="130%" tts:fontStyle="normal" tts:fontWeight="normal" tts:lineHeight="150%" tts:opacity="1" tts:textAlign="center" tts:textDecoration="none" />
<style xml:id="doubleHeight" tts:fontSize="115%" />
<style xml:id="textAlignCenter" tts:textAlign="center" />
</styling>
<layout>
<region xml:id="bottomAligned" tts:displayAlign="after" tts:extent="80% 80%" tts:origin="10% 10%" tts:padding="-2%" tts:writingMode="lrtb" />
</layout>
</head>
<body>
<div style="defaultStyle" xml:id="SGN0">
<p begin="00:00:05.560" end="00:00:07.920" region="bottomAligned" style="textAlignCenter" xml:id="sub1"><span style="WhiteOnBlack doubleHeight">Harry Potter n'est pas stupide.</span></p>
</div>
</body>
</tt>`);
uri = `data:application/ttml+xml;base64,${shaka.util.Uint8ArrayUtils.toBase64(data)}`;
player = video.ui.getControls().getLocalPlayer();
track = await player.addTextTrackAsync(uri, 'en', 'subtitles', "application/ttml+xml", null, null, false);
player.selectTextTrack(track);
video.currentTime = 6;
video.pause();
Now fixed in both contexts.
Have you read the FAQ and checked for duplicate open issues? Yes
What version of Shaka Player are you using? 4.1.1
Can you reproduce the issue with our latest release version? Yes
Can you reproduce the issue with the latest code from
main
? YesAre you using the demo app or your own custom app? A custom app
What browser and OS are you using? Chrome / MacOS
What are the manifest and license server URIs?
What configuration are you using? What is the output of
player.getConfiguration()
?What did you do?
I started a video associated with a ttml subtiles track using shaka-player 4.1.1
On shaka-player 3.2.0: Subtitles are bottom centered (Expected) On shaka-player 4.1.1: Subtitles are top centered (Should be bottom centered like with shaka 3.2.0)
The subtitles shouldn't change position depending on the shaka-player version
What did you expect to happen? Subtitle track is visible and bottom centered like it is on shaka-player 3.2.0
What actually happened?
The subtitles are visible, but the html box it top centered.
The TTML source:
The html generated for shaka-player 3.2.0 (Working case):
The html generated for shaka-player 4.1.1 (Non-working case): I can see a lot of added span compared to the parsing of shaka-player 3.2.0
I wonder if the change made in this PR (included in 4.x) made my ttml non-valid according to the new parser rules, but I don't understand why, and how to fix it: https://github.com/shaka-project/shaka-player/commit/bf67d87387b1dfc4d3d8e0661bfe4efb1e4083b2
Is it the expected behavior after the TTMLParser change? If it's the case, do you know what I can change on the ttml format to make it work?
Thanks for you help on this 🙏