diff --git a/public/styles.css b/public/styles.css index 5465ea6..4a35ece 100644 --- a/public/styles.css +++ b/public/styles.css @@ -545,11 +545,15 @@ main { * Single Video */ article { + width: 100%; + box-sizing: border-box; padding-bottom: calc(var(--gutter) * 3); margin-bottom: calc(var(--gutter) * 3); border-bottom: 1px solid var(--separator); + overflow: hidden; } article .video-content { + width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; @@ -613,16 +617,15 @@ h3[id*="example"]{ font-size: 24px; margin-bottom: calc(var(--gutter) / 2); } -article pre, +article pre code, .code-sample .code-sample--content { - max-width: 760px; - white-space: pre-wrap; + display: block; font-size: 18px; font-family: monospace; padding: var(--gutter); border: 1px solid var(--code-border); background: var(--code-background); - overflow-y: auto; + overflow-x: auto; } .video-container { position: relative; @@ -630,11 +633,14 @@ article pre, max-width: 1200px; margin: 0 auto; overflow: hidden; - aspect-ratio: 16 / 9; + padding-bottom: 56.25%; } .video-container--overlay { display: none; } +.video-container.has-player { + padding-bottom: 0; +} .has-overlay .video-container--overlay { position: absolute; width: 100%; diff --git a/src/api/01-basics/01-single-video.md b/src/api/01-basics/01-single-video.md index 756c2ba..a26e4fa 100644 --- a/src/api/01-basics/01-single-video.md +++ b/src/api/01-basics/01-single-video.md @@ -8,7 +8,6 @@ length: '1:04' video-sources: - src: https://storage.googleapis.com/kino-assets/single-video/video.mp4 type: video/mp4; codecs="avc1.640032,mp4a.40.2" - cast: true thumbnail: https://storage.googleapis.com/kino-assets/single-video/thumbnail.png media-session-artwork: - sizes: 96x96 @@ -29,7 +28,6 @@ media-session-artwork: - sizes: 512x512 src: https://storage.googleapis.com/kino-assets/single-video/artwork-512x512.png type: image/png - --- ## Introduction diff --git a/src/api/03-user-experience/07-autoplay.md b/src/api/03-user-experience/07-autoplay.md new file mode 100644 index 0000000..6b6cbef --- /dev/null +++ b/src/api/03-user-experience/07-autoplay.md @@ -0,0 +1,225 @@ +--- +title: Autoplay +description: | + Learn how to start video playback automatically and employ autoplay strategies that don't lead to degraded user experience. +date: Septembed 22nd, 2021 +length: '1:04' +video-sources: + - src: https://storage.googleapis.com/kino-assets/autoplay/manifest.mpd + type: application/dash+xml + - src: https://storage.googleapis.com/kino-assets/autoplay/master.m3u8 + type: application/x-mpegURL +video-subtitles: + - default: true + kind: captions + label: English + src: https://storage.googleapis.com/kino-assets/autoplay/cap-en.vtt + srclang: en + - default: false + kind: captions + label: Česky + src: https://storage.googleapis.com/kino-assets/autoplay/cap-cs.vtt + srclang: cz +thumbnail: https://storage.googleapis.com/kino-assets/autoplay/thumbnail.png +media-session-artwork: + - sizes: 96x96 + src: https://storage.googleapis.com/kino-assets/autoplay/artwork-96x96.png + type: image/png + - sizes: 128x128 + src: https://storage.googleapis.com/kino-assets/autoplay/artwork-128x128.png + type: image/png + - sizes: 192x192 + src: https://storage.googleapis.com/kino-assets/autoplay/artwork-192x192.png + type: image/png + - sizes: 256x256 + src: https://storage.googleapis.com/kino-assets/autoplay/artwork-256x256.png + type: image/png + - sizes: 384x384 + src: https://storage.googleapis.com/kino-assets/autoplay/artwork-384x384.png + type: image/png + - sizes: 512x512 + src: https://storage.googleapis.com/kino-assets/autoplay/artwork-512x512.png + type: image/png +autoplay: true +--- + +## Introduction + +Sometimes the video is not just a _part_ of your web page content. Sometimes it +is _the_ content and your users expect it to start playing automatically +as soon as possible. + +There are two main ways of accomplishing this autoplay behavior: + +1. Using the `