Skip to content

Commit

Permalink
📖 [Story videos] Add video documentation for Google cache (ampprojec…
Browse files Browse the repository at this point in the history
…t#35609)

* Add video documentation

* More detail

* Added section on amp-story

* Update extensions/amp-story/amp-story.md

Co-authored-by: Gabriel Majoulet <gmajoulet@google.com>

* Updating documentation with approved language

* Simplify amp-story.md

Co-authored-by: Gabriel Majoulet <gmajoulet@google.com>
  • Loading branch information
2 people authored and Mahir committed Sep 9, 2021
1 parent f9ce66d commit 71ab65f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions extensions/amp-story/amp-story.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,20 @@ This same image can be used for both mobile portrait and landscape desktop using
<amp-img src="cat.jpg" alt="..." object-position="75% 40%"></amp-img>
```

##### Optimize `amp-video` by using a free Google hosted video cache on origin documents

The `<amp-video>` element on stories supports the Google video cache to be used on origin documents through the attribute `cache="google"`. The video cache will fetch and store the video contents periodically, reducing serving costs for videos, and generating transcodes with different quality settings that adapt the bitrate to the network conditions.

Use 720p videos or higher to take advantage of all the video transcodes and adaptive bitrate algorithms.

Example:

```html
<amp-video layout="fill" poster="img.png" cache="google">
<source src="video.mp4" type="video/mp4">
</amp-video>
```

##### `data-text-background-color`

The `data-text-background-color` attribute highlights the text of the element with a specified color. To highlight the entire block, add this attribute directly to the text element. To only highlight the text, add the attribute and text to an inner <span>. Note that works anywhere inside an `<amp-story-page>`, not just in `<amp-story-grid-layer>`.
Expand Down
7 changes: 7 additions & 0 deletions extensions/amp-video/0.1/amp-video.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ Indicates the album/collection the video was taken from, specified as a string.

Indicates the name/title of the video, specified as a string. If not provided, the Media Session API helper uses either the `aria-label` attribute or falls back to the page's title.

[filter formats="stories"]

#### cache

Indicates the Google video cache should store and serve the video by adding `cache="google"`. The video cache will fetch and store the video contents periodically, reducing serving costs for videos, and generating transcodes with different quality settings that adapt the bitrate to the network conditions.
[/filter]

## Analytics

`amp-video` supports analytics out of the box. See [video analytics](../../amp-analytics/amp-video-analytics.md) for more information.
Expand Down

0 comments on commit 71ab65f

Please sign in to comment.