plyr自定义视频播放器皮肤主题效果代码

代码语言:html

所属分类:多媒体

代码描述:plyr自定义视频播放器皮肤主题效果代码

代码标签: plyr 电影 视频 播放器 皮肤 主题

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">



    <style>
        @charset "UTF-8";
        @-webkit-keyframes plyr-progress {
          to {
            background-position: 25px 0;
          }
        }
        @keyframes plyr-progress {
          to {
            background-position: 25px 0;
          }
        }
        .plyr {
          position: relative;
          max-width: 100%;
          min-width: 200px;
          font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
          direction: ltr;
        }
        .plyr,
        .plyr *,
        .plyr *::after,
        .plyr *::before {
          box-sizing: border-box;
        }
        .plyr a,
        .plyr button,
        .plyr input,
        .plyr label {
          touch-action: manipulation;
        }
        .plyr:focus {
          outline: 0;
        }
        .plyr video,
        .plyr audio {
          width: 100%;
          height: auto;
          vertical-align: middle;
          border-radius: inherit;
        }
        .plyr input[type=range] {
          display: block;
          height: 20px;
          width: 100%;
          margin: 0;
          padding: 0;
          vertical-align: middle;
          -webkit-appearance: none;
             -moz-appearance: none;
                  appearance: none;
          cursor: pointer;
          border: none;
          background: transparent;
        }
        .plyr input[type=range]::-webkit-slider-runnable-track {
          height: 8px;
          background: transparent;
          border: 0;
          border-radius: 4px;
          -webkit-user-select: none;
                  user-select: none;
        }
        .plyr input[type=range]::-webkit-slider-thumb {
          -webkit-appearance: none;
          margin-top: -4px;
          position: relative;
          height: 16px;
          width: 16px;
          background: #fff;
          border: 2px solid transparent;
          border-radius: 100%;
          -webkit-transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
          transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.15);
          box-sizing: border-box;
        }
        .plyr input[type=range]::-moz-range-track {
          height: 8px;
          background: transparent;
          border: 0;
          border-radius: 4px;
          -moz-user-select: none;
               user-select: none;
        }
        .plyr input[type=range]::-moz-range-thumb {
          position: relative;
          height: 16px;
          width: 16px;
          background: #fff;
          border: 2px solid transparent;
          border-radius: 100%;
          -moz-transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
          transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.15);
          box-sizing: border-box;
        }
        .plyr input[type=range]::-ms-track {
          height: 8px;
          background: transparent;
          border: 0;
          color: transparent;
        }
        .plyr input[type=range]::-ms-fill-upper {
          height: 8px;
          background: transparent;
          border: 0;
          border-radius: 4px;
          -ms-user-select: none;
              user-select: none;
        }
        .plyr input[type=range]::-ms-fill-lower {
          height: 8px;
          background: transparent;
          border: 0;
          border-radius: 4px;
          -ms-user-select: none;
              user-select: none;
          background: #f7bc15;
        }
        .plyr input[type=range]::-ms-thumb {
          position: relative;
          height: 16px;
          width: 16px;
          background: #fff;
          border: 2px solid transparent;
          border-radius: 100%;
          -ms-transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
          transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.15);
          box-sizing: border-box;
          margin-top: 0;
        }
        .plyr input[type=range]::-ms-tooltip {
          display: none;
        }
        .plyr input[type=range]:focus {
          outline: 0;
        }
        .plyr input[type=range]::-moz-focus-outer {
          border: 0;
        }
        .plyr input[type=range].tab-focus:focus {
          outline-offset: 3px;
        }
        .plyr input[type=range]:active::-webkit-slider-thumb {
          background: #f7bc15;
          border-color: #fff;
          transform: scale(1.25);
        }
        .plyr input[type=range]:active::-moz-range-thumb {
          background: #f7bc15;
          border-color: #fff;
          transform: scale(1.25);
        }
        .plyr input[type=range]:active::-ms-thumb {
          background: #f7bc15;
          border-color: #fff;
          transform: scale(1.25);
        }
        
        .plyr--video input[type=range].tab-focus:focus {
          outline: 1px dotted rgba(255, 255, 255, 0.5);
        }
        
        .plyr--audio input[type=range].tab-focus:focus {
          outline: 1px dotted rgba(86, 93, 100, 0.5);
        }
        
        .plyr__sr-only {
          clip: rect(1px, 1px, 1px, 1px);
          overflow: hidden;
          position: absolute !important;
          padding: 0 !important;
          border: 0 !important;
          height: 1px !important;
          width: 1px !important;
        }
        
        .plyr__video-wrapper {
          position: relative;
          background: #000;
          border-radius: inherit;
        }
        
        .plyr__video-embed {
          padding-bottom: 56.25%;
          /* 16:9 */
          height: 0;
          border-radius: inherit;
          overflow: hidden;
          z-index: 0;
        }
        .plyr__video-embed iframe {
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          border: 0;
          -webkit-user-select: none;
             -moz-user-select: none;
              -ms-user-select: none;
                  user-select: none;
        }
        .plyr__video-embed > div {
          position: relative;
          padding-bottom: 200%;
          transform: translateY(-35.95%);
        }
        
        .plyr .plyr__video-embed iframe {
          pointer-events: none;
        }
        
        .plyr video::-webkit-media-text-track-container {
          display: none;
        }
        
        .plyr__captions {
          display: none;
          position: absolute;
          bottom: 0;
          left: 0;
          width: 100%;
          padding: 20px;
          transform: translateY(-60px);
          transition: transform 0.3s ease;
          color: #fff;
          font-size: 16px;
          text-align: center;
          font-weight: 400;
        }
        .plyr__captions span {
          border-radius: 2px;
          padding: 3px 10px;
          background: rgba(0, 0, 0, 0.7);
          -webkit-box-decoration-break: clone;
                  box-decoration-break: clone;
          line-height: 150%;
        }
        .plyr__captions span:empty {
          display: none;
        }
        @media (min-width: 768px) {
          .plyr__captions {
            font-size: 24px;
          }
        }
        
        .plyr--captions-active .plyr__captions {
          display: block;
        }
        
        .plyr--hide-controls .plyr__captions {
          transform: translateY(-20px);
        }
        
        @media (min-width: 1024px) {
          .plyr--fullscreen-active .plyr__captions {
            font-size: 32px;
          }
        }
        .plyr ::-webkit-media-controls {
          display: none;
        }
        
        .plyr__controls {
          display: flex;
          align-items: center;
          line-height: 1;
          text-align: center;
        }
        .plyr__controls > button,
        .plyr__controls .plyr__progress,
        .plyr__controls .plyr__time {
          margin-left: 5px;
        }
        .plyr__controls > button:first-child,
        .plyr__controls .plyr__progress:first-child,
        .plyr__controls .plyr__time:first-child {
          margin-left: 0;
        }
        .plyr__controls .plyr__volume {
          margin-left: 5px;
        }
        .plyr__controls [data-plyr=pause] {
          margin-left: 0;
        }
        .plyr__controls button {
          position: relative;
          display: inline-block;
          flex-shrink: 0;
          overflow: visible;
          vertical-align: middle;
          padding: 7px;
          border: 0;
          background: transparent;
          border-radius: 3px;
          cursor: pointer;
          transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
          color: inherit;
        }
        .plyr__controls button svg {
          width: 18px;
          height: 18px;
          display: block;
          fill: currentColor;
        }
        .plyr__controls button:focus {
          outline: 0;
        }
        .plyr__controls .icon--exit-fullscreen,
        .plyr__controls .icon--muted,
        .plyr__controls .icon--captions-on {
          display: none;
        }
        @media (min-width: 480px) {
          .plyr__controls > button,
        .plyr__controls .plyr__progress,
        .plyr__controls .plyr__time {
            margin-left: 10px;
          }
        }
        
        .plyr--hide-controls .plyr__controls {
          opacity: 0;
          pointer-events: none;
        }
        
        .plyr--video .plyr__controls {
          position: absolute;
          left: 0;
          right: 0;
          bottom: 0;
          padding: 50px 10px 10px;
          background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5));
          border-bottom-left-radius: inherit;
          border-bottom-right-radius: inherit;
          color: #fff;
          transition: opacity 0.3s ease;
        }
        .plyr--video .plyr__controls button.tab-focus:focus, .plyr--video .plyr__controls button:hover {
          background: #f7bc15;
          color: #fff;
        }
        
        .plyr--audio .plyr__controls {
          padding: 10px;
          border-radius: inherit;
          background: #fff;
          border: 1px solid #dbe3e8;
          color: #565D64;
        }
        .plyr--audio .plyr__controls button.tab-focus:focus, .plyr--audio .plyr__controls button:hover {
          background: #f7bc15;
          color: #fff;
        }
        
        .plyr__play-large {
          display: none;
          position: absolute;
          z-index: 1;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          padding: 10px;
          background: #f7bc15;
          border: 4px solid currentColor;
          border-radius: 100%;
          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    .........完整代码请登录后点击上方下载按钮下载查看

网友评论0