乐趣区

关于前端:西瓜播放器自定义加载中状态Demo

<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <meta name=viewport
 content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui">
 <meta name="referrer" content="no-referrer">
 <title>xgplayer</title>
 <style type="text/css">
 html,
 body {
 width: 100%;
 height: 100%;
 margin: auto;
 overflow: hidden;
 }
 /* 加载中的背景封面 */
 #mse /deep/ .xgplayer-enter {background: url(https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=312440173,484202537&fm=26&gp=0.jpg) no-repeat 50%/cover;

 }
 /* 加载中的两头 logo */
 #mse /deep/ .xgplayer-enter .xgplayer-enter-logo {background: url(https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2148934937,3777971823&fm=26&gp=0.jpg) no-repeat 50%/cover;
 }
 /* 加载中的进度色彩 */
 #mse /deep/ .xgplayer-enter .xgplayer-enter-tips {
 position: absolute;
 left: 50%;
 top: 50%;
 width: 120px;
 height: 1px;
 margin: 32px auto auto -62px;
 background: linear-gradient(90deg, #000, red, rgb(0, 38, 255), red, #000);
 }
 </style>
</head>

<body>

 <div id="mse"></div>

 <script src="//cdn.jsdelivr.net/npm/xgplayer@1.1.4/browser/index.js" charset="utf-8"></script>

 <script>

 let player = new Player({

 "id": "mse",

 "url": "http://live.hqjy.com/live/541448853_219043351.flv?auth_key=1600068358-102c4a7e69ef42e6b3559f7e02ce849f-0-7c1b2a1b8203ad2b6b45af4811a7e659",

 "playsinline": true,

 "whitelist": [""],"playbackRate": [0.5, 0.75, 1, 1.5, 2],"width":"600","height":"300","poster":"https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3437217665,1564280326&fm=26&gp=0.jpg"

 });

 </script>

</body>

  

</html>
退出移动版