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

TTML - styles applied to body are not applied to cues. #3741

Closed
avelad opened this issue Nov 4, 2021 · 1 comment
Closed

TTML - styles applied to body are not applied to cues. #3741

avelad opened this issue Nov 4, 2021 · 1 comment
Labels
component: UI The issue involves the Shaka Player UI priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@avelad
Copy link
Collaborator

avelad commented Nov 4, 2021

Have you read the FAQ and checked for duplicate open issues? Yes

What version of Shaka Player are you using? Master

Can you reproduce the issue with our latest release version? Don't apply

Can you reproduce the issue with the latest code from master? Yes

Are you using the demo app or your own custom app? Demo app

If custom app, can you reproduce the issue using our demo app?

What browser and OS are you using?
Any witth MSE support

For embedded devices (smart TVs, etc.), what model and firmware version are you using?

What are the manifest and license server URIs?

https://livesim.dashif.org/dash/vod/testpic_2s/multi_subs.mpd

What configuration are you using? What is the output of player.getConfiguration()?

Default

What did you do?

Load the previous stream and enable ENG subtitles

What did you expect to happen?
The subtitle are rendered correctly

What actually happened?

The subtitle aren't rendered correctly
The body style is not inherited in the TTML parser an the font-size, text-align, etc are not applied

Shaka Player
image

Dash-if
image

TTML file

<?xml version="1.0" encoding="UTF-8"?>
<tt ttp:cellResolution="32 15" ttp:timeBase="media" xml:lang="eng" xml:space="default" xmlns="http://www.w3.org/ns/ttml" xmlns:ebuttm="urn:ebu:metadata" xmlns:ebutts="urn:ebu:style" 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">
  <head>
    <metadata>
      <ttm:title>DASH-IF Live Simulator</ttm:title>
      <ebuttm:documentMetadata>
        <ebuttm:conformsToStandard>urn:ebu:distribution:2014-01</ebuttm:conformsToStandard>
        <ebuttm:authoredFrameRate>30</ebuttm:authoredFrameRate>
      </ebuttm:documentMetadata>
    </metadata>
    <styling>
      <style tts:color="#FFFFFF" tts:fontFamily="sansSerif" tts:fontSize="100%" tts:fontStyle="normal" tts:lineHeight="normal" tts:textAlign="center" tts:wrapOption="noWrap" xml:id="s0"/>
      <style ebutts:linePadding="0.5c" tts:backgroundColor="#000000" tts:color="#00FF00" xml:id="s1"/>
      <style ebutts:linePadding="0.5c" tts:backgroundColor="#000000" tts:color="#ff0000" xml:id="s2"/>
    </styling>
    <layout>
      <region tts:displayAlign="before" tts:extent="70% 20%" tts:origin="15% 80%" tts:overflow="visible" xml:id="r0"/>
      <region tts:displayAlign="before" tts:extent="70% 20%" tts:origin="15% 20%" tts:overflow="visible" xml:id="r1"/>
    </layout>
  </head>
  <body style="s0">
    <div region="r0">
      <p begin="00:00:00.000" end="00:00:01.000" xml:id="sub00000">
        <span style="s1">eng : 00:00:00.000</span>
      </p>
      <p begin="00:00:01.000" end="00:00:02.000" xml:id="sub01000">
        <span style="s1">eng : 00:00:01.000</span>
      </p>
    </div>
  </body>
</tt>
@avelad avelad added the type: bug Something isn't working correctly label Nov 4, 2021
@shaka-bot shaka-bot added this to the v3.3 milestone Nov 4, 2021
@TheModMaker
Copy link
Contributor

The font size looks correct, but the alignment is wrong. It looks like the region positioning is being applied twice, so the inner cue is being positioned relative to an outer <div>, which is also positioned.

@TheModMaker TheModMaker added component: UI The issue involves the Shaka Player UI priority: P1 Big impact or workaround impractical; resolve before feature release labels Nov 15, 2021
joeyparrish pushed a commit that referenced this issue Jan 28, 2022
This changes the TTML parser to not allow cue regions to be inherited
to the children of the element the region was originally assigned on,
except for the purposes of styles (colors, etc).
To allow regions on elements "above" the cues in TTML, such as the
<body> or <div> elements, this also changes the TTML parser to render
the full structure of the TTML file as a tree of cues. The end result
will be a single cue representing the <body>, with children
representing the <div> elements inside it, and those <divs> will have
children that represent the actual cues. Now that our text displayer
can intelligently update child cues as they enter or leave the display
window, this approach should be possible.

Closes #3850
Closes #3741

Backported to v3.1.x

Change-Id: Ia8d750daa06920610c04e9b26e29d2d304eaf8a9
joeyparrish pushed a commit that referenced this issue Jan 28, 2022
This changes the TTML parser to not allow cue regions to be inherited
to the children of the element the region was originally assigned on,
except for the purposes of styles (colors, etc).
To allow regions on elements "above" the cues in TTML, such as the
<body> or <div> elements, this also changes the TTML parser to render
the full structure of the TTML file as a tree of cues. The end result
will be a single cue representing the <body>, with children
representing the <div> elements inside it, and those <divs> will have
children that represent the actual cues. Now that our text displayer
can intelligently update child cues as they enter or leave the display
window, this approach should be possible.

Closes #3850
Closes #3741

Backported to v3.2.x

Change-Id: Ia8d750daa06920610c04e9b26e29d2d304eaf8a9
joeyparrish pushed a commit that referenced this issue Jan 28, 2022
This changes the TTML parser to not allow cue regions to be inherited
to the children of the element the region was originally assigned on,
except for the purposes of styles (colors, etc).
To allow regions on elements "above" the cues in TTML, such as the
<body> or <div> elements, this also changes the TTML parser to render
the full structure of the TTML file as a tree of cues. The end result
will be a single cue representing the <body>, with children
representing the <div> elements inside it, and those <divs> will have
children that represent the actual cues. Now that our text displayer
can intelligently update child cues as they enter or leave the display
window, this approach should be possible.

Closes #3850
Closes #3741

Change-Id: Ia8d750daa06920610c04e9b26e29d2d304eaf8a9
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Mar 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2022
@avelad avelad modified the milestones: v3.3, v4.0 May 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: UI The issue involves the Shaka Player UI priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants