✨[Amp story captions] Use amp-story-captions for captions from cache#38108
✨[Amp story captions] Use amp-story-captions for captions from cache#38108processprocess merged 19 commits intoampproject:mainfrom
Conversation
|
Can you append a screenshot of how these captions look? My worry is that the captions can be hidden if a video is on a background layer with an overlay (like on our pottery story), so we might want to add the captions onto a new top-level grid-layer so they are always visible on top. I remember this being one of the main complaints of the native captions |
|
Converting to draft. Blocked by #37967 |
Converting to draft until #37967 is merged. |
| if (this.element.hasAttribute('auto-append')) { | ||
| this.container_.classList.add(`amp-story-captions-auto-append`); |
There was a problem hiding this comment.
I think you could set a class direclty from the JSX template
There was a problem hiding this comment.
That wont work since this element is rendered in shadow dom.
There was a problem hiding this comment.
The fact that style-preset=default behaves different depending on if we automatically appended it or not is tripping me a bit.
Can you provide an example of how you position the default preset as a publisher, and what the default position is if a publisher doesn't write any code?
There was a problem hiding this comment.
It trips me a bit too.
The thought process is this:
- If it's auto-appended we base it on the expected UX of captions and position it relative to the video.
- It it's publisher specified the assumption is that it's intentionally placed.
The example for publisher writing no code is already in examples/amp-story/amp-story-captions.html as part of #37967
There was a problem hiding this comment.
Okay it's a bit tricky, thank you for sharing.
Two things would be awesome if we could make them work together:
- Using
style-preset=defaultworks awesome out of the box, without requiring a single line of CSS - Publishers can override the default position set by
style-preset=default
If both things can't coexist, then let's keep things how you have them.
There was a problem hiding this comment.
To follow up from our discussion:
- It looks awesome out of the box both inline and auto-attached.
- It can be placed anywhere when inline. When auto-attached it is locked in a position.
extensions/amp-story-captions/0.1/amp-story-captions-presets.css
Outdated
Show resolved
Hide resolved
extensions/amp-story-captions/0.1/amp-story-captions-presets.css
Outdated
Show resolved
Hide resolved
| if (this.element.hasAttribute('auto-append')) { | ||
| this.container_.classList.add(`amp-story-captions-auto-append`); |
There was a problem hiding this comment.
The fact that style-preset=default behaves different depending on if we automatically appended it or not is tripping me a bit.
Can you provide an example of how you position the default preset as a publisher, and what the default position is if a publisher doesn't write any code?
|
This pull request introduces 1 alert when merging d11bf73 into 31c8027 - view on LGTM.com new alerts:
|
d11bf73 to
e2d2fb8
Compare
|
This pull request introduces 1 alert when merging 0f15cbb into 01dad70 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 1eecd64 into 01dad70 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging d2e8e12 into 01dad70 - view on LGTM.com new alerts:
|
|
Warning: disparity between this PR Percy build and its The Percy build for this PR was approved (either manually by a member of the AMP team, or automatically if there were no visual diffs). However, during a continuous integration step we generated another Percy build using the commit on the This is possibly an indication of an issue with this pull request, but could also be the result of flakiness. Please inspect the two builds < This PR's Percy build /
|
demo
** The demo is automatically appending from a track element since cached captions are not launched yet **
When appending captions from cache this PR
amp-story-captionscomponentdefaultcaptions styleAutomatically appended captions are positioned so they do not block CTA UI. mockup:

Closes #37899