@uncinq/css-components 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/components/push.css +0 -8
- package/docs/content/push.md +1 -3
- package/docs/embeds/video.md +8 -0
- package/package.json +1 -1
package/css/components/push.css
CHANGED
|
@@ -127,14 +127,6 @@
|
|
|
127
127
|
.btn-toggle-video {
|
|
128
128
|
pointer-events: auto;
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
/* Safari draws a play button over a video it refuses to autoplay, in
|
|
132
|
-
Low Power Mode for one. The button sits in the browser's shadow DOM,
|
|
133
|
-
which only gives way to !important. */
|
|
134
|
-
video::-webkit-media-controls-start-playback-button {
|
|
135
|
-
-webkit-appearance: none;
|
|
136
|
-
display: none !important;
|
|
137
|
-
}
|
|
138
130
|
}
|
|
139
131
|
|
|
140
132
|
.surtitle {
|
package/docs/content/push.md
CHANGED
|
@@ -43,9 +43,7 @@ The push takes the taller of the two boxes: a text that needs more room than the
|
|
|
43
43
|
|
|
44
44
|
## The media is a background
|
|
45
45
|
|
|
46
|
-
`.media` takes `pointer-events: none`: a click on the image or the video goes through to the push and its link, and a tap never starts or pauses a video. The pause control that a [`.video`](../../embeds/video/) lays over an autoplaying video is the exception, set back to `pointer-events: auto`, since WCAG requires a way to stop it. A video that needs its native `controls` does not belong in a push.
|
|
47
|
-
|
|
48
|
-
Safari draws a play button over a video it refuses to autoplay, in Low Power Mode for instance. The push hides it through `::-webkit-media-controls-start-playback-button`, with the one `!important` of the component: the button lives in the browser's shadow DOM, and nothing weaker overrides it there. The video then shows its first frame, or its poster.
|
|
46
|
+
`.media` takes `pointer-events: none`: a click on the image or the video goes through to the push and its link, and a tap never starts or pauses a video. The pause control that a [`.video`](../../embeds/video/) lays over an autoplaying video is the exception, set back to `pointer-events: auto`, since WCAG requires a way to stop it. A video that needs its native `controls` does not belong in a push. For the play button Safari draws over a background video in Low Power Mode, see [Video](../../embeds/video/#autoplay-checklist): no CSS hides it.
|
|
49
47
|
|
|
50
48
|
## What the push hands down
|
|
51
49
|
|
package/docs/embeds/video.md
CHANGED
|
@@ -51,3 +51,11 @@ A [`.media`](../../content/media/) stretches the wrapper to fill it, so a video
|
|
|
51
51
|
## Autoplay checklist
|
|
52
52
|
|
|
53
53
|
`muted` is required for autoplay to be allowed at all, and `playsinline` keeps iOS from taking the video fullscreen. `loop` is what makes a background video a background video. All three are attributes on the element, not something this component can supply.
|
|
54
|
+
|
|
55
|
+
`autoplay` itself is better left out. In Low Power Mode, or when the device runs hot, Safari refuses to autoplay and forces its own play button over every video that carries the attribute. WebKit does this on purpose, and the button lives in a closed shadow root: `::-webkit-media-controls-start-playback-button` no longer reaches it, `!important` or not. Start the video from script instead, and ignore the refusal:
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
video.play().catch(() => {});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Without the attribute Safari draws nothing. The video stays on its poster or its first frame, and `.btn-toggle-video` is there to start it.
|