带配置的视频播放器效果
代码语言:html
所属分类:多媒体
代码描述:带配置的视频播放器效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
:root {
--mdl-switch-thumb: #ff1744;
--mdl-switch-track: #ef9a9a;
/* player min width */
/* --player-min-width: 412px; */
}
* {
-webkit-font-smoothing: antialiased;
font-family: 'Roboto', sans-serif;
}
button:focus {
outline: none;
}
button::-moz-focus-inner {
outline: none;
border: 0;
}
body {
box-sizing: border-box;
margin: 0;
background-color: #d2d100;
/* background-color: hsl(170, 90%, 57%); */
/* background-color: #18ffff; */
}
#player {
box-sizing: border-box;
display: block;
/* width: 880px; */
/* height: 480px; */
width: 100%;
height: 100vh;
/* max-width: 1280px; */
/* max-height: 720px; */
font-family: "Roboto", sans-serif;
margin: 0 auto;
position: relative;
/* background-color: hsl(240, 100%, 50%); */
/* background-color: #9c27b0; */
/* background-color: #673ab7; */
background-color: #000;
}
#video {
width: 100%;
max-width: 100%;
height: 100%;
}
#video > video {
display: block;
height: 100%;
width: auto;
max-width: 100%;
margin: auto;
}
#controls {
box-sizing: border-box;
display: block;
width: 100%;
text-align: center;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#fullscreen_top-bar {
box-sizing: border-box;
display: flex;
width: 100%;
height: 88px;
padding: 24px;
flex-direction: row;
background: linear-gradient(tobottom, rgb(0, 0, 0.75), rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0));
align-items: center;
justify-content: space-between;
}
#video-title {
color: #fff;
white-space: nowrap;
margin-right: 36px;
}
#share-btn {
display: flex;
width: 40px;
height: 40px;
border-radius: 50%;
align-items: center;
justify-content: center;
}
#share-icon {
transform: rotateY(180deg);
}
/* change this so that it can only be applied to the buttons inside the player on the whole page when embedded into a webpage */
button {
border: 0;
cursor: pointer;
background-color: transparent;
transition: background 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
#big-play-btn-container,
#big-play-btn,
#big-pause-btn {
box-sizing: border-box;
width: 114px;
height: 114px;
position: absolute;
top: 50%;
left: 50%;
border-radius: 50%;
transform: translate(-50%, -50%);
transition: box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
#big-play-btn,
#big-pause-btn {
display: block;
padding: 20px;
border: 0;
background-color: #fff;
}
#big-play-btn.invisible-btn,
#big-pause-btn.invisible-btn {
display: none;
}
@keyframes ripples {
from {
box-shadow: 0 0 0 0px rgba(255, 255, 255, 0.55);
}
to {
box-shadow: 0 0 0 24px rgba(255, 255, 255, 0.1);
}
}
#big-play-btn-container.video-loading {
animation: ripples 1.24s forwards infinite cubic-bezier(0.4, 0, 0.3, 1);
}
#loading-icon {
display: flex;
width: 64px;
height: 64px;
position: absolute;
top: 50%;
left: 50%;
border-radius: 50%;
transform: translate(-50%, -50%);
background-color: hsla(150, 90%, 40%, 0.5);
align-items: center;
justify-content: center;
}
#player_subtitle-container {
box-sizing: border-box;
display: block;
width: 100%;
padding: 0 24px;
position: absolute;
left: 0;
right: 0;
bottom: 112px;
/* background-color: #fff; */
}
#player_subtitle-container.subtitle-fullscreen {
box-sizing: border-box;
display: block;
width: 100%;
padding: 0 24px;
position: absolute;
left: 0;
right: 0;
bottom: 114px;
/* background-color: #fff; */
}
#player_subtitle-container.invisible {
display: none;
}
#player_subtitle {
display: inline-block;
padding: 2px 5px;
margin: 0 30px;
font-size: 15px;
border-radius: 5px;
line-height: 1.35;
letter-spacing: normal;
color: #fff;
background-color: rgba(0, 0, 0, 0.9);
}
#player_subtitle-container.subtitle-fullscreen #player_subtitle {
padding: 4px 8px;
margin: 0 45px;
font-size: 22px;
border-radius: 5px;
/* line-height: 40px; */
}
#player_control-bar {
box-sizing: border-box;
display: flex;
width: 100%;
height: 112px;
padding: 4px 0 24px;
flex-wrap: nowrap;
flex-direction: column;
position: absolute;
right: 0;
left: 0;
bottom: 0;
align-items: stretch;
justify-content: flex-start;
/* background-color: hsla(240, 100%, 50%, 0.75); */
}
#main-controls {
box-sizing: border-box;
display: flex;
width: 100%;
height: 48px;
padding: 0 24px;
flex-direction: row;
justify-content: space-between;
align-items: center;
/* background-color: hsla(170, 100%, 35%, 0.75); */
/* background-color: hsla(270, 100%, 0%, 0.9); */
border-radius: 5px;
}
#video-duration {
margin: 0 16px 0 0;
padding-left: 6px;
white-space: nowrap;
}
#video-duration,
#current-time,
#duration {
color: #fff;
font-size: 20px;
}
#player_control-bar_cta-btns {
display: flex;
width: auto;
flex-direction: row;
flex: 1 1 172px;
margin: 0 0 0 auto;
justify-content: flex-end;
}
.cta-btn {
box-sizing: padding-box;
display: inline-block;
width: 48px;
height: 48px;
border-radius: 50%;
margin-left: 4px;
padding: 8px;
}
.cta-btn:hover {
background-color: rgba(255, 255, 255, 0.5);
}
#subtitle-toggle-btn {
position: relative;
}
#subtitle-toggle-btn.active::after {
content: '';
box-sizing: border-box;
display: inline-block;
width: 27px;
height: 3px;
position: absolute;
left: 11px;
right: 10px;
bottom: 6px;
transform-origin: 50%;
background-color: #f00;
}
#player-settings {
display: inline-block;
position: absolute;
bottom: 100%;
right: 24px;
border-radius: 7px;
color: #fff;
background-color: rgba(0, 0, 0, 0.9);
}
#settings_home-view {
display: block;
width: 205px;
padding: 10px;
}
#settings_home-view.fullscreen {
width: 282px;
padding: 12px;
}
#settings_home-view_options,
.settings_home-view_options_item {
list-style: none;
margin: 0;
padding: 0;
}
#settings_home-view_options {
display: flex;
flex-direction: column;
justify-content: center;
align-items: space-between;
}
.settings_home-view_options_item {
margin-bottom: 4px;
}
.settings_home-view_options_item:last-child {
margin-bottom: 0;
}
.settings_home-view_options_item button {
display: flex;
height: 40px;
width: 100%;
color: inherit;
flex-direction: row;
font-size: 14px;
border: 0;
border-radius: 5px;
padding: 0px 10px;
cursor: pointer;
background-color: transparent;
align-items: center;
justify-content: space-between;
}
.settings_home-view_options_item.fullscreen button {
height: 50px;
font-size: 20px;
padding: 0 16px;
}
.settings_home-view_options_item button:hover {
background-color: rgba(255, 255, 255, 0.14);
}
.setting-text {
font-weight: 500;
}
#setting-speed-btn,
#setting-quality-btn {
padding-right: 3px;
}
.settings_home-view_options_item.fullscreen #setting-speed-btn,
.settings_home-view_options_item.fullscreen #setting-quality-btn {
padding-right: 5px;
}
.current-setting-icon > svg {
width: 28px;
height: 28px;
}
.current-setting-icon.fullscreen > svg {
width: 40px;
height: 40px;
}
#quality-auto-active {
font-weight: 400;
margin-right: 3px;
}
#current-auto-selected-quality {
font-weight: 300;
}
#quality-auto-active + span {
font-size: 13px;
font-size: 0.875em;
line-height: 1.2;
}
#player_range-input {
box-sizing: border-box;
padding: 2px 18px 2px;
margin-top: 2px;
/* background-color: hsla(55, 100%, 50%, 0.75); */
}
/* MATERIAL DESIGN LITE BASIC STYLE */
a, .mdl-accordion, .mdl-button, .mdl-card, .mdl-checkbox, .mdl-dropdown-menu,
.mdl-icon-toggle, .mdl-item, .mdl-radio, .mdl-slider, .mdl-switch, .mdl-tabs__tab {
-webkit-tap-highlight-color: transparent;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}
/* MATERIAL DESIGN LITE BASIC STYLE */
/* MATERIAL SLIDER START */
/* MATERIAL SLIDER START */
/* MATERIAL SLIDER START */
_:-ms-input-placeholder,
:root .mdl-slider.mdl-slider.is-upgraded {
-ms-appearance: none;
height: 38px;
margin: 0;
}
.mdl-slider {
width: 100%;
margin: 0;
}
.mdl-slider.is-upgraded {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
height: 30px;
/* changed */
background: transparent;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
outline: 0;
padding: 0;
color: rgb(255,0,0);
/* changed */
-webkit-align-self: center;
-ms-flex-item-align: center;
-ms-grid-row-align: center;
align-self: center;
z-index: 1;
cursor: pointer;
}
.mdl-slider.is-upgraded::-moz-focus-outer {
border: 0;
}
.mdl-slider.is-upgraded::-ms-tooltip {
display: none;
}
.mdl-slider.is-upgraded::-webkit-slider-runnable-track {
background: transparent;
}
.mdl-slider.is-upgraded::-moz-range-track {
background: transparent;
border: none;
}
.mdl-slider.is-upgraded::-ms-tra.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0