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

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

Powered by Google App Engine
This is Rietveld 408576698