Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: Source/core/css/mediaControlsNew.css

Issue 1156993013: New media playback UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: manual rebaseline. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /**/ 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2015 Google Inc.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26 /* Chromium default media controls */
27
28 /* WARNING: This css file can only style <audio> and <video> elements */
29
30 audio:not([controls]) {
31 display: none !important;
32 }
33
34 audio {
35 width: 300px;
36 height: 48px;
37 }
38
39 audio::-webkit-media-controls,
40 video::-webkit-media-controls {
41 width: inherit;
42 height: inherit;
43 position: relative;
44 direction: ltr;
45 display: flex;
46 flex-direction: column;
47 justify-content: flex-end;
48 align-items: center;
49 }
50
51 audio::-webkit-media-controls-enclosure, video::-webkit-media-controls-enclosure {
52 width: 100%;
53 height: 48px;
54 flex-shrink: 0;
55 bottom: 0;
56 text-indent: 0;
57 padding: 0;
58 margin: 0;
philipj_slow 2015/07/08 10:31:52 This was added, does it make a difference? In gene
liberato (no reviews please) 2015/07/09 12:10:56 de-cruft is still pending, probably in PS20.
59 box-sizing: border-box;
60 }
61
62 audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
63 display: flex;
64 flex-direction: row;
65 align-items: center;
66 /* We use flex-start here to ensure that the play button is visible even
67 * if we are too small to show all controls.
68 */
69 justify-content: flex-start;
70 -webkit-user-select: none;
71 position: relative;
72 width: 100%;
73 z-index: 0;
74 overflow: hidden;
75 text-align: right;
76 bottom: auto;
77 height: 48px;
78 min-width: 48px;
79 background-color: #fafafa;
80 margin: 0;
81 padding: 0;
82 /* The duration is also specified in MediaControlElements.cpp and LayoutTest s/media/media-controls.js */
83 transition: opacity 0.3s;
84
85 font-family: Segoe, "Helvetica Neue", Roboto, Arial, Helvetica, sans-serif ;
86 font-size: 14px;
87 font-weight: normal; /* Make sure that we don't inherit non-defaults. */
88 font-style: normal;
89 }
90
91 video:-webkit-full-page-media {
92 margin: auto;
93 position: absolute;
94 top: 0;
95 right: 0;
96 bottom: 0;
97 left: 0;
98 }
99
100 audio:-webkit-full-page-media, video:-webkit-full-page-media {
101 max-height: 100%;
102 max-width: 100%;
103 }
104
105 audio:-webkit-full-page-media::-webkit-media-controls-panel,
106 video:-webkit-full-page-media::-webkit-media-controls-panel {
107 bottom: 0px;
108 }
109
110 audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-bu tton {
111 -webkit-appearance: media-mute-button;
112 display: flex;
113 flex: none;
114 border: none;
115 box-sizing: border-box;
116 width: 48px;
117 height: 48px;
118 line-height: 48px;
119 margin: 0;
120 padding: 12px;
philipj_slow 2015/07/08 10:31:52 The amount of whitespace around the mute button lo
liberato (no reviews please) 2015/07/09 12:10:56 i've forwarded this feedback to the design team.
liberato (no reviews please) 2015/07/14 22:10:36 the new whitespace is from the style guide, and is
121 background-color: initial;
122 color: inherit;
123 }
124
125 audio::-webkit-media-controls-overlay-enclosure {
126 display: none;
127 }
128
129 video::-webkit-media-controls-overlay-enclosure {
130 display: flex;
131 position: relative;
132 flex-direction: column;
133 justify-content: flex-end;
134 align-items: center;
135 flex: 1 1;
136 min-height: 0;
137 width: 100%;
138 margin-bottom: 10px;
139 text-indent: 0;
140 box-sizing: border-box;
141 overflow: hidden;
142 }
143
144 video::-webkit-media-controls-overlay-play-button {
145 -webkit-appearance: media-overlay-play-button;
146 display: flex;
147 position: absolute;
148 top: 0;
149 left: 0;
150 margin: 0;
151 border: none;
152 box-sizing: border-box;
153 background-color: transparent;
154 width: 100%;
155 height: 100%;
156 padding: 0;
157 }
158
159 video::-internal-media-controls-overlay-cast-button {
160 -webkit-appearance: -internal-media-overlay-cast-off-button;
161 display: flex;
162 position: absolute;
163 top: 5%;
164 left: 5%;
165 margin-left: 0px;
166 margin-top: 0px;
167 border: none;
168 box-sizing: border-box;
169 background-color: transparent;
170 width: 30px;
171 height: 30px;
172 padding: 0;
173 }
174
175 audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-bu tton {
176 -webkit-appearance: media-play-button;
177 display: flex;
178 flex: none;
179 border-sizing: border-box;
180 width: 48px;
181 height: 48px;
182 line-height: 48px;
183 padding: 12px;
184 background-color: initial;
185 color: inherit;
186 }
187
188 audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls- timeline-container {
189 -webkit-appearance: media-controls-background;
190 display: flex;
191 flex-direction: row;
192 align-items: center;
193 justify-content: flex-end;
194 flex: 1 1;
195 -webkit-user-select: none;
196 height: 48px;
197 margin: 0;
198 padding: 0;
199 min-width: 0;
200 }
201
202 audio::-webkit-media-controls-current-time-display, video::-webkit-media-control s-current-time-display {
203 -webkit-appearance: media-current-time-display;
204 -webkit-user-select: none;
205 flex: none;
206 display: flex;
207 border: none;
208 cursor: default;
209
210 height: 48px;
211
212 /* text runs right to the edge of the container */
213 margin: 0;
214 padding: 0;
215
216 line-height: 48px;
217 color: #5a5a5a;
218
219 letter-spacing: normal;
220 word-spacing: normal;
221 text-transform: none;
222 text-indent: 0;
223 text-shadow: none;
224 text-decoration: none;
225 }
226
227 audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-contr ols-time-remaining-display {
228 -webkit-appearance: media-current-time-display;
229 -webkit-user-select: none;
230 flex: none;
231 display: flex;
232 border: none;
233 cursor: default;
234
235 height: 48px;
236
237 /* text runs right to the edge of the container, plus a little on
238 * the left to pad the leading "/" */
239 margin: 0;
240 padding: 0 0 0 4px;
241
242 line-height: 48px;
243 color: #5a5a5a;
244
245 letter-spacing: normal;
246 word-spacing: normal;
247 text-transform: none;
248 text-indent: 0;
249 text-shadow: none;
250 text-decoration: none;
251 }
252
253 audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
254 -webkit-appearance: media-slider;
255 display: flex;
256 flex: 1 1 auto;
257 height: 48px;
258
259 /* Leave 6px on either side for the thumb. Use margin so that
260 * the slider doesn't extend into it. We also add 12px border.
261 */
262 padding: 0;
263 margin: 0 18px 0 18px;
264 background-color: transparent;
265 min-width: 25px;
266 border: initial;
267 color: inherit;
268 }
269
270 audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volum e-slider {
271 -webkit-appearance: media-volume-slider;
272 display: flex;
273 /* The 1.9 value was empirically chosen to match old-flexbox behaviour
274 * and be aesthetically pleasing.
275 */
276 flex: 1 1.9 auto;
277 height: 48px;
278 max-width: 70px;
279 /* Leave room for the thumb, which has 6px radius. Use margin rather
280 * than padding so that the slider doesn't extend into it. We also
281 * leave an addition 12px margin.
282 */
283 padding: 0;
284 margin: 0 18px 0 18px;
285 background-color: transparent;
286 min-width: 25px;
287 border: initial;
288 color: inherit;
289 }
290
291 /* FIXME these shouldn't use special pseudoShadowIds, but nicer rules.
292 https://code.google.com/p/chromium/issues/detail?id=112508
293 https://bugs.webkit.org/show_bug.cgi?id=62218
294 */
295 input[type="range" i]::-webkit-media-slider-container {
296 display: flex;
297 align-items: center;
298 flex-direction: row; /* This property is updated by C++ code. */
299 box-sizing: border-box;
300 /** this positions the slider thumb for both time and volume. */
301 height: 48px;
302 width: 100%;
303 padding: 0;
304 margin: 0;
305 background-color: transparent; /* Background drawing is managed by C++ code to draw ranges. */
306 }
307
308 /* The negative right margin causes the track to overflow its container. */
309 input[type="range" i]::-webkit-media-slider-container > div {
310 margin-right: -18px; /* box is 36px wide, get to the middle */
311 margin-left: -18px;
312 }
313
314 input[type="range" i]::-webkit-media-slider-thumb {
315 box-sizing: border-box;
316 width: 48px;
317 height: 48px;
318 padding: 0px;
319 margin: 0px;
320 }
321
322 audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-f ullscreen-button {
323 -webkit-appearance: media-enter-fullscreen-button;
324 display: flex;
325 flex: none;
326 overflow: hidden;
327 border: none;
328 box-sizing: border-box;
329 width: 48px;
330 height: 48px;
331 line-height: 48px;
332 background-color: initial;
333 color: inherit;
334 }
335
336 audio::-internal-media-controls-cast-button, video::-internal-media-controls-cas t-button {
337 -webkit-appearance: -internal-media-cast-off-button;
338 display: flex;
339 flex: none;
340 border: none;
341 box-sizing: border-box;
342 width: 48px;
343 height: 48px;
344 line-height: 48px;
345 margin-left: 0px;
346 margin-right: 0px;
347 padding: 12px;
348 background-color: initial;
349 color: inherit;
350 }
351
352 audio::-webkit-media-controls-toggle-closed-captions-button {
353 display: none;
354 }
355
356 video::-webkit-media-controls-toggle-closed-captions-button {
357 -webkit-appearance: media-toggle-closed-captions-button;
358 display: flex;
359 flex: none;
360 border: none;
361 box-sizing: border-box;
362 width: 48px;
363 height: 48px;
364 line-height: 48px;
365 margin-left: 0px;
366 margin-right: 0px;
367 padding: 12px;
368 background-color: initial;
369 color: inherit;
370 }
371
372 audio::-webkit-media-controls-fullscreen-volume-slider, video::-webkit-media-con trols-fullscreen-volume-slider {
373 display: none;
374 }
375
376 audio::-webkit-media-controls-fullscreen-volume-min-button, video::-webkit-media -controls-fullscreen-volume-min-button {
377 display: none;
378 }
379
380 audio::-webkit-media-controls-fullscreen-volume-max-button, video::-webkit-media -controls-fullscreen-volume-max-button {
381 display: none;
382 }
383
384 video::-webkit-media-text-track-container {
385 position: relative;
386 width: inherit;
387 height: inherit;
388 overflow: hidden;
389
390 font: 22px sans-serif;
391 text-align: center;
392 color: rgba(255, 255, 255, 1);
393
394 letter-spacing: normal;
395 word-spacing: normal;
396 text-transform: none;
397 text-indent: 0;
398 text-decoration: none;
399 pointer-events: none;
400 -webkit-user-select: none;
401 word-break: break-word;
402 }
403
404 video::cue {
405 display: inline;
406
407 background-color: rgba(0, 0, 0, 0.8);
408 padding: 2px 2px;
409 }
410
411 video::-webkit-media-text-track-region {
412 position: absolute;
413 line-height: 5.33vh;
414 writing-mode: horizontal-tb;
415 background: rgba(0, 0, 0, 0.8);
416 color: rgba(255, 255, 255, 1);
417 word-wrap: break-word;
418 overflow-wrap: break-word;
419 overflow: hidden;
420 }
421
422 video::-webkit-media-text-track-region-container {
423 position: relative;
424
425 display: flex;
426 flex-flow: column;
427 flex-direction: column;
428 }
429
430 video::-webkit-media-text-track-region-container.scrolling {
431 transition: top 433ms linear;
432 }
433
434
435 video::-webkit-media-text-track-display {
436 position: absolute;
437 overflow: hidden;
438 white-space: pre-wrap;
439 -webkit-box-sizing: border-box;
440 flex: 0 0 auto;
441 }
442
443 video::cue(:future) {
444 color: gray;
445 }
446
447 video::-webkit-media-text-track-container b {
448 font-weight: bold;
449 }
450
451 video::-webkit-media-text-track-container u {
452 text-decoration: underline;
453 }
454
455 video::-webkit-media-text-track-container i {
456 font-style: italic;
457 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698