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

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: minor decrufting. 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;
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 /* The duration is also specified in MediaControlElements.cpp and LayoutTest s/media/media-controls.js */
81 transition: opacity 0.3s;
82
83 font-family: Segoe, "Helvetica Neue", Roboto, Arial, Helvetica, sans-serif ;
84 font-size: 14px;
85 font-weight: normal; /* Make sure that we don't inherit non-defaults. */
86 font-style: normal;
87 }
88
89 video:-webkit-full-page-media {
90 margin: auto;
91 position: absolute;
92 top: 0;
93 right: 0;
94 bottom: 0;
95 left: 0;
96 }
97
98 audio:-webkit-full-page-media, video:-webkit-full-page-media {
99 max-height: 100%;
100 max-width: 100%;
101 }
102
103 audio:-webkit-full-page-media::-webkit-media-controls-panel,
104 video:-webkit-full-page-media::-webkit-media-controls-panel {
105 bottom: 0px;
106 }
107
108 audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-bu tton {
109 -webkit-appearance: media-mute-button;
110 display: flex;
111 flex: none;
112 border: none;
113 width: 48px;
114 height: 48px;
115 line-height: 48px;
116 padding: 12px;
117 background-color: initial;
118 color: inherit;
119 }
120
121 audio::-webkit-media-controls-overlay-enclosure {
122 display: none;
123 }
124
125 video::-webkit-media-controls-overlay-enclosure {
126 display: flex;
127 position: relative;
128 flex-direction: column;
129 justify-content: flex-end;
130 align-items: center;
131 flex: 1 1;
132 min-height: 0;
133 width: 100%;
134 margin-bottom: 10px;
135 text-indent: 0;
136 box-sizing: border-box;
137 overflow: hidden;
138 }
139
140 video::-webkit-media-controls-overlay-play-button {
141 -webkit-appearance: media-overlay-play-button;
142 display: flex;
143 position: absolute;
144 top: 0;
145 left: 0;
146 margin: 0;
147 border: none;
148 background-color: transparent;
149 width: 100%;
150 height: 100%;
151 padding: 0;
152 }
153
154 video::-internal-media-controls-overlay-cast-button {
155 -webkit-appearance: -internal-media-overlay-cast-off-button;
156 display: flex;
157 position: absolute;
158 top: 5%;
159 left: 5%;
160 margin-left: 0px;
161 margin-top: 0px;
162 border: none;
163 background-color: transparent;
164 width: 48px;
165 height: 48px;
166 padding: 0;
167 transition: opacity 0.3s;
168 }
169
170 audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-bu tton {
171 -webkit-appearance: media-play-button;
172 display: flex;
173 flex: none;
174 border-sizing: border-box;
175 width: 48px;
176 height: 48px;
177 line-height: 48px;
178 padding: 12px;
179 background-color: initial;
180 color: inherit;
181 }
182
183 audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls- timeline-container {
184 -webkit-appearance: media-controls-background;
185 display: flex;
186 flex-direction: row;
187 align-items: center;
188 justify-content: flex-end;
189 flex: 1 1;
190 -webkit-user-select: none;
191 height: 48px;
192 padding: 0;
193 min-width: 0;
194 }
195
196 audio::-webkit-media-controls-current-time-display, video::-webkit-media-control s-current-time-display {
197 -webkit-appearance: media-current-time-display;
198 -webkit-user-select: none;
199 flex: none;
200 display: flex;
201 border: none;
202 cursor: default;
203
204 height: 48px;
205
206 /* text runs right to the edge of the container */
207 padding: 0;
208
209 line-height: 48px;
210 color: #5a5a5a;
211
212 letter-spacing: normal;
213 word-spacing: normal;
214 text-transform: none;
215 text-indent: 0;
216 text-shadow: none;
217 text-decoration: none;
218 }
219
220 audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-contr ols-time-remaining-display {
221 -webkit-appearance: media-current-time-display;
222 -webkit-user-select: none;
223 flex: none;
224 display: flex;
225 border: none;
226 cursor: default;
227
228 height: 48px;
229
230 /* text runs right to the edge of the container, plus a little on
231 * the left to pad the leading "/" */
232 padding: 0 0 0 4px;
233
234 line-height: 48px;
235 color: #5a5a5a;
236
237 letter-spacing: normal;
238 word-spacing: normal;
239 text-transform: none;
240 text-indent: 0;
241 text-shadow: none;
242 text-decoration: none;
243 }
244
245 audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
246 -webkit-appearance: media-slider;
247 display: flex;
248 flex: 1 1 auto;
249 height: 2px;
250
251 /* Leave 6px on either side for the thumb. Use margin so that
252 * the slider doesn't extend into it. We also add 12px border.
253 */
254 padding: 0;
255 margin: 0 18px 0 18px;
256 background-color: transparent;
257 min-width: 25px;
258 border: initial;
259 color: inherit;
260 }
261
262 audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volum e-slider {
263 -webkit-appearance: media-volume-slider;
264 display: flex;
265 /* The 1.9 value was empirically chosen to match old-flexbox behaviour
266 * and be aesthetically pleasing.
267 */
268 flex: 1 1.9 auto;
269 height: 2px;
270 max-width: 70px;
271 /* Leave room for the thumb, which has 6px radius. Use margin rather
272 * than padding so that the slider doesn't extend into it. We also
273 * leave an addition 12px margin.
274 */
275 padding: 0;
276 margin: 0 18px 0 18px;
277 background-color: transparent;
278 min-width: 25px;
279 border: initial;
280 color: inherit;
281 }
282
283 /* FIXME these shouldn't use special pseudoShadowIds, but nicer rules.
284 https://code.google.com/p/chromium/issues/detail?id=112508
285 https://bugs.webkit.org/show_bug.cgi?id=62218
286 */
287 input[type="range" i]::-webkit-media-slider-container {
288 display: flex;
289 align-items: center;
290 flex-direction: row; /* This property is updated by C++ code. */
291 box-sizing: border-box;
292 /** this positions the slider thumb for both time and volume. */
293 height: 2px;
294 width: 100%;
295 background-color: transparent; /* Background drawing is managed by C++ code to draw ranges. */
296 }
297
298 /* The negative right margin causes the track to overflow its container. */
299 input[type="range" i]::-webkit-media-slider-container > div {
300 margin-right: -18px; /* box is 36px wide, get to the middle */
301 margin-left: -18px;
302 }
303
304 input[type="range" i]::-webkit-media-slider-thumb {
305 box-sizing: border-box;
306 width: 48px;
307 height: 48px;
308 padding: 0px;
309 }
310
311 audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-f ullscreen-button {
312 -webkit-appearance: media-enter-fullscreen-button;
313 display: flex;
314 flex: none;
315 overflow: hidden;
316 border: none;
317 width: 48px;
318 height: 48px;
319 line-height: 48px;
320 background-color: initial;
321 color: inherit;
322 }
323
324 audio::-internal-media-controls-cast-button, video::-internal-media-controls-cas t-button {
325 -webkit-appearance: -internal-media-cast-off-button;
326 display: flex;
327 flex: none;
328 border: none;
329 width: 48px;
330 height: 48px;
331 line-height: 48px;
332 margin-left: 0px;
333 margin-right: 0px;
334 padding: 12px;
335 background-color: initial;
336 color: inherit;
337 }
338
339 audio::-webkit-media-controls-toggle-closed-captions-button {
340 display: none;
341 }
342
343 video::-webkit-media-controls-toggle-closed-captions-button {
344 -webkit-appearance: media-toggle-closed-captions-button;
345 display: flex;
346 flex: none;
347 border: none;
348 width: 48px;
349 height: 48px;
350 line-height: 48px;
351 margin-left: 0px;
352 margin-right: 0px;
353 padding: 12px;
354 background-color: initial;
355 color: inherit;
356 }
357
358 audio::-webkit-media-controls-fullscreen-volume-slider, video::-webkit-media-con trols-fullscreen-volume-slider {
359 display: none;
360 }
361
362 audio::-webkit-media-controls-fullscreen-volume-min-button, video::-webkit-media -controls-fullscreen-volume-min-button {
363 display: none;
364 }
365
366 audio::-webkit-media-controls-fullscreen-volume-max-button, video::-webkit-media -controls-fullscreen-volume-max-button {
367 display: none;
368 }
369
370 video::-webkit-media-text-track-container {
371 position: relative;
372 width: inherit;
373 height: inherit;
374 overflow: hidden;
375
376 font: 22px sans-serif;
377 text-align: center;
378 color: rgba(255, 255, 255, 1);
379
380 letter-spacing: normal;
381 word-spacing: normal;
382 text-transform: none;
383 text-indent: 0;
384 text-decoration: none;
385 pointer-events: none;
386 -webkit-user-select: none;
387 word-break: break-word;
388 }
389
390 video::cue {
391 display: inline;
392
393 background-color: rgba(0, 0, 0, 0.8);
394 padding: 2px 2px;
395 }
396
397 video::-webkit-media-text-track-region {
398 position: absolute;
399 line-height: 5.33vh;
400 writing-mode: horizontal-tb;
401 background: rgba(0, 0, 0, 0.8);
402 color: rgba(255, 255, 255, 1);
403 word-wrap: break-word;
404 overflow-wrap: break-word;
405 overflow: hidden;
406 }
407
408 video::-webkit-media-text-track-region-container {
409 position: relative;
410
411 display: flex;
412 flex-flow: column;
413 flex-direction: column;
414 }
415
416 video::-webkit-media-text-track-region-container.scrolling {
417 transition: top 433ms linear;
418 }
419
420
421 video::-webkit-media-text-track-display {
422 position: absolute;
423 overflow: hidden;
424 white-space: pre-wrap;
425 -webkit-box-sizing: border-box;
426 flex: 0 0 auto;
427 }
428
429 video::cue(:future) {
430 color: gray;
431 }
432
433 video::-webkit-media-text-track-container b {
434 font-weight: bold;
435 }
436
437 video::-webkit-media-text-track-container u {
438 text-decoration: underline;
439 }
440
441 video::-webkit-media-text-track-container i {
442 font-style: italic;
443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698