AMP

Important: this documentation is not applicable to your currently selected format stories!

amp-story-captions

Description

The amp-story-captions component allows custom video or audio caption rendering. See https://github.com/ampproject/amphtml/issues/34016 for the design.

 

Required Scripts

<script async custom-element="amp-story-captions" src="https://cdn.ampproject.org/v0/amp-story-captions-0.1.js"></script>

The amp-story-captions component allows custom video or audio caption rendering. See https://github.com/ampproject/amphtml/issues/34016 for the design.

Note that container layout in this component is different to all other components because the HTML tree does not determine the size. Instead, the text height of the dynamically loaded captions determine the size. Thus it may cause CLS issue if the caption content changes while playing the video or audio.

Need more help?

You've read this document a dozen times but it doesn't really cover all of your questions? Maybe other people felt the same: reach out to them on Stack Overflow.

Go to Stack Overflow
Found a bug or missing a feature?

The AMP project strongly encourages your participation and contributions! We hope you'll become an ongoing participant in our open source community but we also welcome one-off contributions for the issues you're particularly passionate about.

Go to GitHub