mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
17c2b0b49e
This is currently only supported in Chromium browsers (it is behind a feature flag in Firefix and WebKit doesn't have it), if you don't want o enable the setting at the operating system level to test this, you can simulate it in the "Rendering" tab in the Chromium developer tools.
167 lines
4.3 KiB
Plaintext
167 lines
4.3 KiB
Plaintext
/** @license
|
|
* Shaka Player
|
|
* Copyright 2016 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/* The main buttons in the UI controls. */
|
|
|
|
@play-button-size-percentage: 15%;
|
|
|
|
.disabled-button() {
|
|
/* Set the background and the color, otherwise it might be overwritten by
|
|
* the css styles in demo. */
|
|
background-color: transparent;
|
|
color: @general-font-color;
|
|
cursor: default;
|
|
}
|
|
|
|
/* The giant play button, which sits inside .shaka-player-button-container. */
|
|
.shaka-play-button {
|
|
/* Set width & height in a round-about way. By using padding, we can keep
|
|
* a 1:1 aspect ratio and size the button relative to the container width.
|
|
*
|
|
* Since padding is applied equally to top, bottom, left, and right, only use
|
|
* half of the intended percentage for each.
|
|
*
|
|
* Based on tips from https://stackoverflow.com/a/12925343 */
|
|
box-sizing: border-box;
|
|
padding: calc(@play-button-size-percentage / 2);
|
|
width: 0;
|
|
height: 0;
|
|
|
|
/* To be properly positioned in the center, this should have no margin.
|
|
* This might have been set for buttons generally by the app or user-agent. */
|
|
margin: 0;
|
|
|
|
/* This makes the button a circle. */
|
|
border-radius: 50%;
|
|
|
|
/* A small drop shadow below the button. */
|
|
box-shadow: rgba(0, 0, 0, 10%) 0 0 20px 0;
|
|
|
|
/* No border. */
|
|
border: none;
|
|
|
|
/* The play arrow is a picture. It is treated a background image.
|
|
* The following settings ensure it shows only once and in the
|
|
* center of the button. */
|
|
background-size: 50%;
|
|
background-repeat: no-repeat;
|
|
background-position: center center;
|
|
|
|
/* A background color behind the play arrow. */
|
|
background-color: rgba(255, 255, 255, 90%);
|
|
|
|
.show-when-controls-shown();
|
|
|
|
/* Actual icon images for the two states this could be in.
|
|
* These will be inlined as data URIs when compiled, and so do not need to be
|
|
* deployed separately from the compiled CSS.
|
|
* Note that these URIs should relative to ui/controls.less, not this file. */
|
|
&[icon="play"] {
|
|
background-image: data-uri("images/play_arrow.svg");
|
|
}
|
|
|
|
&[icon="pause"] {
|
|
background-image: data-uri("images/pause.svg");
|
|
}
|
|
|
|
&[icon="replay"] {
|
|
background-image: data-uri("images/replay.svg");
|
|
}
|
|
|
|
@media (prefers-reduced-transparency: no-preference) {
|
|
.shaka-controls-container[shown="true"] & {
|
|
opacity: 0.75;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* This button contains the current time and duration of the video.
|
|
* It's only clickable when the content is live, and current time is behind live
|
|
* edge. Otherwise, the button is disabled.
|
|
*/
|
|
.shaka-current-time {
|
|
font-size: @general-font-size;
|
|
color: @general-font-color;
|
|
cursor: pointer;
|
|
width: auto;
|
|
padding: 0 5px;
|
|
|
|
&[disabled] {
|
|
.disabled-button();
|
|
}
|
|
}
|
|
|
|
/* Use a consistent outline focus style across browsers. */
|
|
.shaka-controls-container {
|
|
button:focus, input:focus {
|
|
/* Most browsers will fall back to "Highlight" (system setting) color for
|
|
* the focus outline. */
|
|
outline: 1px solid Highlight;
|
|
}
|
|
|
|
/* Disable this Mozilla-specific focus ring, since we have an outline defined
|
|
* for focus. */
|
|
button:-moz-focus-inner, input:-moz-focus-outer {
|
|
outline: none;
|
|
border: 0;
|
|
}
|
|
}
|
|
|
|
/* Outline on focus is important for accessibility, but
|
|
* it doesn't look great. This removes the outline for
|
|
* mouse users while leaving it for keyboard users. */
|
|
.shaka-controls-container:not(.shaka-keyboard-navigation) {
|
|
button:focus, input:focus {
|
|
outline: none;
|
|
}
|
|
}
|
|
|
|
.shaka-fast-forward-container,
|
|
.shaka-rewind-container {
|
|
height: 100%;
|
|
width: 100%;
|
|
.shrinkable();
|
|
.absolute-position();
|
|
|
|
/* Keep all the elements inside button div in center and in row */
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: center;
|
|
align-items: center;
|
|
|
|
/* To be properly positioned, this should have no margin. */
|
|
margin: 0;
|
|
|
|
/* No border. */
|
|
border: none;
|
|
|
|
color: @general-font-color;
|
|
background-color: @general-background-color;
|
|
|
|
cursor: default;
|
|
font-size: 20px;
|
|
|
|
/* Hidding the container by setting opacity */
|
|
opacity: 0;
|
|
|
|
/* Make the text inside this button unselectable */
|
|
.unselectable();
|
|
}
|
|
|
|
.shaka-fast-forward-container {
|
|
border-radius: 40% 0 0 40%;
|
|
}
|
|
|
|
.shaka-rewind-container {
|
|
border-radius: 0 40% 40% 0;
|
|
}
|
|
|
|
/* This class is instead of material-icon-round
|
|
* because the font-size of 24 doesn't look good */
|
|
.shaka-forward-rewind-container-icon {
|
|
font-size: 32px;
|
|
}
|