带配置的视频播放器效果

代码语言: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;
        }

        #subti.........完整代码请登录后点击上方下载按钮下载查看

网友评论0