supervideo实现一个自带弹幕画中画的视频播放器代码

代码语言:html

所属分类:多媒体

代码描述:supervideo实现一个自带弹幕画中画的视频播放器代码,可调节播放速度和音量。

代码标签: 自带 弹幕画 画的 视频 播放器

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

<!DOCTYPE html>
<html lang="cn">

<head>
   
<link href="css/main-css.css" rel="stylesheet">
</head>

<head>
   
<meta charset="utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
   
<meta name="viewport" content="width=device-width,initial-scale=1.0">
   
<title></title>
   
<style>
        html,body {
            width: 100%;
            height: 100%;
            background-color: #292929;
          }
          * {
            padding: 0;
            margin: 0;
          }
           /* 设置视频外部容器样式 */
          #videoContainer {
            width: 800px;
            height: 500px;
            margin-left: auto;
            margin-right: auto;
            margin-top: 80px;
          }
          @font-face {
        font-family: 'iconfont';  /* project id 1867770 */
        src: url('https://at.alicdn.com/t/font_1867770_5pzef3csvso.eot');
        src: url('https://at.alicdn.com/t/font_1867770_5pzef3csvso.eot?#iefix') format('embedded-opentype'),
        url('https://at.alicdn.com/t/font_1867770_5pzef3csvso.woff2') format('woff2'),
        url('https://at.alicdn.com/t/font_1867770_5pzef3csvso.woff') format('woff'),
        url('https://at.alicdn.com/t/font_1867770_5pzef3csvso.ttf') format('truetype'),
        url('https://at.alicdn.com/t/font_1867770_5pzef3csvso.svg#iconfont') format('svg');
      }
   
    .sv-target video {
        background-color: #000000;
        object-fit: fill;
        cursor: pointer;
    }
   
    .sv-font {
        font-family: 'iconfont';
    }
   
    .sv-pic-pic {
        color: #ffffff;
        font-size: 20px;
        margin-right: 6px;
    }
   
    .sv-play {
        color: #ffffff;
        font-size: 20px;
    }
   
    .sv-fontBtn {
        color: #ffffff;
        font-size: 20px;
    }
   
    .sv-next {
        color: #ffffff;
        font-size: 20px;
    }
   
    .sv-fullScreen {
        color: #ffffff;
        font-size: 20px;
    }
   
    .sv-cancelFull {
        color: #ffffff;
        font-size: 20px;
    }
   
    .sv-target {
        position: relative;
    }
    .sv-control {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
    .sv-play-container {
        height: 100%;
        /* background-color: royalblue; */
        display: flex;
        flex-direction: row;
        padding-right: 10px;
    }
    .sv-control-r {
        height: 100%;
        /* background-color: royalblue; */
        display: flex;
        flex-direction: row;
        padding-left: 10px;
        padding-right: 10px;
    }
    .sv-play-container button.sv-playBtn {
        background: none;
        border: none;
        cursor: pointer;
        padding: 0 10px;
        outline: none;
        color: inherit;
        text-align: inherit;
        font: inherit;
        line-height: inherit;
        margin-left: 10px;
    }
   
    .sv-control-r .showMute {
        background: none;
        border: none;
        cursor: pointer;
        padding: 0 10px;
        outline: none;
        color: inherit;
        text-align: inherit;
        font: inherit;
        line-height: inherit;
        position: relative;
    }
    .showMute span:nth-child(1) {
        display: block;
        padding: 20px 0;
    }
   
    .sv-time {
        height: 100%;
        color: #ffffff;
        display: flex;
        flex-direction: row;
        align-items: center;
        font-size: 12px;
    }
   
    .sv-time-split {
        padding: 0 4px;
    }
   
    .sv-mutePanel {
        position: absolute;
        top: -120px;
        left: 0;
        width: 20px;
        height: 80px;
        background-color: rgba(0, 0, 0, 0.8);
        display: flex;
        flex-direction: column;
        padding: 16px 6px;
        border-radius: 4px;
    }
   
    .sv-mute-num {
        width: 100%;
        height: 20px;
        background-color: transparent;
        color: #ffffff;
        font-size: 12px;
        text-align: center;
        margin-bottom: 4px;
    }
   
    .sv-mute-slider {
        flex: 1;
        width: 3px;
        background-color: #ffffff;
        margin: 0 auto;
        position: relative;
        display: flex;
        flex-direction: column-reverse;
    }
   
    .sv-mute-sliderRange {
        width: 100%;
        background-color: #00a1d6;
    }
   
    .sv-control-r button.sv-mute-button {
        position: absolute;
        top: 0;
        left: -4.5px;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        z-index: 10;
        background-color: #00a1d6;
        border: 0;
        cursor: pointer;
        outline: none;
    }
   
    .sv-progressBar {
        position: absolute;
        /* top: 0; */
        bottom: 60px;
        left: 2%;
        width: 96%;
        height: 2px;
        background-color: hsla(0,0%,100%,.2);
        border-radius: 4px;
        cursor: pointer;
    }
   
    .sv-cacheProgress {
        width: 0%;
        height: 100%;
        background-color: #7a7878;
        border-radius: 4px;
    }
   
    .sv-progressNum {
        width: 0%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        border-radius: 4px;
        background-color: #00a1d6;
    }
   
    .sv-progressBtn {
        position: absolute;
        left: 0%;
        top: -7px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background-color: rgba(0, 161, 214, 0.5);
        cursor: pointer;
    }
    .sv-progressBtn>div {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: #00a1d6;
        margin-top: 2.6px;
        margin-left: 2.8px;
    }
   
    .hide {
        display: none!important;
    }
   
    .sv-full-screen {
        position: fixed!important;
        width: 100%!important;
        height: 100%!important;
        left: 0!important;
        top: 0!important;
        margin: 0!important;
        padding: 0!important;
        z-index: 9999999!important;
    }
   
    /* loading */
    .sv-container-loading {
        width: 40vw;
        height: 40vw;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        margin: auto;
        overflow: hidden;
      }
     
      .sv-common {
        height: 5vw;
        max-height: 100%;
        overflow: auto;
        width: 2vw;
        margin: auto;
        max-width: 100%;
        position: absolute;
        border-radius: 0vw 10vw 0vw 10vw;
        box-shadow: inset 0vw 0vw 0vw .1vw #E645D0, 0vw 0vw 1.5vw 0vw #E645D0;
      }
     
      .sv-one {
        transform: rotate(45deg);
        left: 0;
        right: 0;
        top: 0;
        bottom: 7.5vw;
      }
     
      .sv-two {
        transform: rotate(90deg);
        left: 5.5vw;
        right: 0;
        top: 0;
        bottom: 5.5vw;
      }
     
      .sv-three {
        transform: rotate(135deg);
        left: 7.5vw;
        right: 0;
        top: 0;
        bottom: 0;
      }
     
      .sv-four {
        transform: rotate(180deg);
        left: 5.5vw;
        right: 0;
        top: 5.5vw;
        bottom: 0;
      }
     
      .sv-five {
        transform: rotate(225deg);
        left: 0;
        right: 0;
        top: 7.5vw;
        bottom: 0;
      }
     
      .sv-six {
        transform: rotate(270deg);
        left: 0;
        right: 5.5vw;
        top: 5.5vw;
        bottom: 0;
      }
     
      .sv-seven {
        transform: rotate(315deg);
        left: 0;
        right: 7.5vw;
        top: 0;
        bottom: 0;
      }
     
      .sv-eight {
        transform: rotate(360deg);
        left: 0;
        right: 5.5vw;
        top: 0;
        bottom: 5.5vw;
      }
     
      .sv-one {
        animation: one 1s ease infinite;
        -moz-animation: one 1s ease infinite;
        /* Firefox */
        -webkit-animation: one 1s ease infinite;
        /* Safari and Chrome */
        -o-animation: one 1s ease inf.........完整代码请登录后点击上方下载按钮下载查看

网友评论0