Comparing version 0.2.4 to 0.2.5
@@ -25,6 +25,10 @@ 'use strict'; | ||
function copyright() { | ||
console.log('\n %c EPlayer 0.2.5 %c eplayer.js.org \n', 'color: #fff; background: linear-gradient(to right,#57a1fc ,#6beaf7); padding:5px;', 'color: #7192c3; background: #ecfaff; padding:5px 0;'); | ||
} | ||
var Init = function Init(el, data) { | ||
_classCallCheck(this, Init); | ||
var html = '\n <link rel="stylesheet" href="//at.alicdn.com/t/font_836948_8so67ueev32.css">\n <style>\n #player {\n background:#000;\n width: 100%;\n height: 100%;\n position: relative;\n }\n #player video {\n width: 100%;\n height: 100%;\n }\n #player .panel {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%,-50%);\n }\n #player .wrap {\n height: 100%;\n width: 100%;\n }\n #player .panels .epicon {\n font-size: 80px\n }\n #player .controls {\n width: 100%;\n position: absolute;\n bottom: 0;\n padding: 0 15px;\n box-sizing: border-box;\n }\n #player .option {\n position: relative;\n display:flex;\n align-items: center;\n padding: 10px 0;\n }\n #player .option-left{\n display: flex;\n flex: 1;\n align-items: center;\n }\n #player .option-right{\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: flex-end\n }\n #player .progress-bar {\n width: 100%;\n position: relative;\n cursor: pointer;\n }\n #player .volume-progress-bar {\n width: 100px;\n position: relative;\n cursor: pointer;\n }\n #player .volume-progress {\n height: 5px;\n background-color: rgba(255, 255, 255, 0.8);\n }\n #player .progress {\n height: 5px;\n background-color: rgba(255, 255, 255, 0.8);\n }\n #player .dot {\n padding: 20px;\n position: absolute;\n top: -18px;\n left: -18px;\n }\n #player .dot i {\n height: 13px;\n width: 13px;\n background: ' + data.themeColor + ';\n position: absolute;\n border-radius: 50%;\n top: 50%;\n left:50%;\n transform:translate(-50%,-50%)\n }\n #player .volume {\n display: flex;\n align-items: center;\n padding-right: 15px;\n }\n #player .current-progress {\n width: 0%;\n height: 100%;\n background: ' + data.themeColor + ';\n position: absolute;\n top: 0;\n }\n #player .buffer {\n width: 0%;\n height: 100%;\n background: ' + data.themeColor + ';\n opacity:.4;\n position: absolute;\n top: 0;\n }\n #player .time {\n text-align: center;\n font-size: 12px;\n color: #fff;\n padding-left: 15px;\n }\n #player .epicon:hover {\n color: #fff;\n }\n #player .epicon {\n color: rgba(255, 255, 255, 0.8);\n cursor: pointer;\n transition: 0.3s;\n font-size: 24px;\n }\n #player .ep-volume-down,.ep-volume-up,.ep-volume-off {\n padding-right: 15px\n }\n #player .loading {\n position: absolute;\n top: 50%;\n left: 50%;\n margin:-20px 0 0 -20px;\n width: 40px;\n height: 40px;\n border: 5px solid;\n border-color: rgba(255, 255, 255, 0.8) rgba(255, 255, 255, 0.8) transparent;\n border-radius: 50%;\n box-sizing: border-box;\n animation: loading 1s linear infinite;\n }\n @keyframes loading{\n 0%{\n transform: rotate(0deg);\n }\n 100%{\n transform: rotate(360deg);\n } \n }\n @keyframes display{\n 0%{\n opacity: 1;\n }\n 100%{\n opacity: 0;\n }\n }\n </style>\n <div id="player">\n <video src="' + data.src + '" id="video"></video>\n <div class="panels">\n <div class="loading"></div>\n <i class="epicon ep-play panel" style="display:none;"></i>\n </div>\n <div class="controls">\n <div class="progress-bar">\n <div class="current-progress"></div>\n <div class="buffer"></div>\n <div class="dot">\n <i></i>\n </div>\n <div class="progress"></div>\n </div>\n <div class="option">\n <div class="option-left">\n <div class="control">\n <i class="epicon ep-play switch"></i>\n </div>\n <div class="time">\n <span class="current">00:00</span>\n /\n <span class="total">00:00</span>\n </div>\n </div>\n <div class="option-right"> \n <div class="volume">\n <i class="epicon ep-volume-up volume-button"></i>\n <div class="volume-progress-bar">\n <div class="volume-progress"></div>\n <div class="current-progress"></div>\n <div class="dot">\n <i></i>\n </div>\n </div>\n </div> \n <div class="control">\n <i class="epicon ep-full full"></i>\n </div> \n </div>\n </div>\n </div>\n </div>\n '; | ||
var html = '\n <link rel="stylesheet" href="//at.alicdn.com/t/font_836948_8so67ueev32.css">\n <style>\n #player {\n background:#000;\n width: 100%;\n height: 100%;\n position: relative;\n }\n #player video {\n width: 100%;\n height: 100%;\n }\n #player .panel {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%,-50%);\n }\n #player .wrap {\n height: 100%;\n width: 100%;\n }\n #player .panels .epicon {\n font-size: 80px\n }\n #player .controls {\n width: 100%;\n position: absolute;\n bottom: 0;\n padding: 0 15px;\n box-sizing: border-box;\n }\n #player .option {\n position: relative;\n display:flex;\n align-items: center;\n padding: 10px 0;\n }\n #player .option-left{\n display: flex;\n flex: 1;\n align-items: center;\n }\n #player .option-right{\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: flex-end\n }\n #player .progress-bar {\n width: 100%;\n position: relative;\n cursor: pointer;\n }\n #player .volume-progress-bar {\n width: 100px;\n position: relative;\n cursor: pointer;\n }\n #player .volume-progress {\n border-radius:2px;\n height: 4px;\n background-color: rgba(255, 255, 255, 0.8);\n }\n #player .progress {\n border-radius:2px;\n height: 4px;\n background-color: rgba(255, 255, 255, 0.8);\n }\n #player .dot {\n padding: 20px;\n position: absolute;\n top: -18px;\n left: -18px;\n }\n #player .dot i {\n height: 13px;\n width: 13px;\n background: ' + data.themeColor + ';\n position: absolute;\n border-radius: 50%;\n top: 50%;\n left:50%;\n transform:translate(-50%,-50%)\n }\n #player .volume {\n display: flex;\n align-items: center;\n padding-right: 15px;\n }\n #player .current-progress {\n width: 0%;\n height: 100%;\n background: ' + data.themeColor + ';\n position: absolute;\n border-radius:2px;\n top: 0;\n }\n #player .buffer {\n width: 0%;\n height: 100%;\n background: ' + data.themeColor + ';\n opacity:.4;\n position: absolute;\n border-radius:2px;\n top: 0;\n }\n #player .time {\n text-align: center;\n font-size: 12px;\n color: #fff;\n padding-left: 15px;\n }\n #player .epicon:hover {\n color: #fff;\n }\n #player .epicon {\n color: rgba(255, 255, 255, 0.8);\n cursor: pointer;\n transition: 0.3s;\n font-size: 24px;\n }\n #player .ep-volume-down,.ep-volume-up,.ep-volume-off {\n padding-right: 15px\n }\n #player .loading {\n position: absolute;\n top: 50%;\n left: 50%;\n margin:-20px 0 0 -20px;\n width: 40px;\n height: 40px;\n border: 4px solid;\n border-color: rgba(255, 255, 255, 0.8) rgba(255, 255, 255, 0.8) transparent;\n border-radius: 50%;\n box-sizing: border-box;\n animation: loading 1s linear infinite;\n }\n @keyframes loading{\n 0%{\n transform: rotate(0deg);\n }\n 100%{\n transform: rotate(360deg);\n } \n }\n @keyframes display{\n 0%{\n opacity: 1;\n }\n 100%{\n opacity: 0;\n }\n }\n </style>\n <div id="player">\n <video src="' + data.src + '" id="video"></video>\n <div class="panels">\n <div class="loading"></div>\n <i class="epicon ep-play panel" style="display:none;"></i>\n </div>\n <div class="controls">\n <div class="progress-bar">\n <div class="current-progress"></div>\n <div class="buffer"></div>\n <div class="dot">\n <i></i>\n </div>\n <div class="progress"></div>\n </div>\n <div class="option">\n <div class="option-left">\n <div class="control">\n <i class="epicon ep-play switch"></i>\n </div>\n <div class="time">\n <span class="current">00:00</span>\n /\n <span class="total">00:00</span>\n </div>\n </div>\n <div class="option-right"> \n <div class="volume">\n <i class="epicon ep-volume-up volume-button"></i>\n <div class="volume-progress-bar">\n <div class="volume-progress"></div>\n <div class="current-progress"></div>\n <div class="dot">\n <i></i>\n </div>\n </div>\n </div> \n <div class="control">\n <i class="epicon ep-full full"></i>\n </div> \n </div>\n </div>\n </div>\n </div>\n '; | ||
el.innerHTML = html; | ||
@@ -49,2 +53,3 @@ }; | ||
var OFFSETDOT = 18; | ||
copyright(); | ||
@@ -51,0 +56,0 @@ var Eplayer = function () { |
{ | ||
"name": "eplayer", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "A simple html5 video player", | ||
@@ -8,3 +8,4 @@ "main": "./lib/eplayer.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"start": "parcel index.html" | ||
"start": "parcel index.html", | ||
"build": "parcel build index.html" | ||
}, | ||
@@ -11,0 +12,0 @@ "repository": { |
@@ -10,5 +10,5 @@ <p align="center"><img src="http://wx2.sinaimg.cn/mw690/0060lm7Tly1fva3l3izvtj30dw0dwjs1.jpg" alt="eplayer logo" width="150px"></p> | ||
### Demo | ||
#### who use eplayer? | ||
[clicli](http://localhost:3000/p/82) | ||
[clicli.us](https://www.clicli.us/) | ||
@@ -15,0 +15,0 @@ ### Install |
import { Init } from './init' | ||
import { Hls } from './hls' | ||
import { getTimeStr, isFullScreen } from './util' | ||
import { getTimeStr, isFullScreen, copyright } from './util' | ||
const OFFSETDOT = 18 | ||
copyright() | ||
@@ -7,0 +8,0 @@ class Eplayer { |
@@ -64,7 +64,9 @@ export class Init { | ||
#player .volume-progress { | ||
height: 5px; | ||
border-radius:2px; | ||
height: 4px; | ||
background-color: rgba(255, 255, 255, 0.8); | ||
} | ||
#player .progress { | ||
height: 5px; | ||
border-radius:2px; | ||
height: 4px; | ||
background-color: rgba(255, 255, 255, 0.8); | ||
@@ -98,2 +100,3 @@ } | ||
position: absolute; | ||
border-radius:2px; | ||
top: 0; | ||
@@ -107,2 +110,3 @@ } | ||
position: absolute; | ||
border-radius:2px; | ||
top: 0; | ||
@@ -135,3 +139,3 @@ } | ||
height: 40px; | ||
border: 5px solid; | ||
border: 4px solid; | ||
border-color: rgba(255, 255, 255, 0.8) rgba(255, 255, 255, 0.8) transparent; | ||
@@ -138,0 +142,0 @@ border-radius: 50%; |
@@ -18,1 +18,9 @@ export function getTimeStr(time) { | ||
} | ||
export function copyright() { | ||
console.log( | ||
'\n %c EPlayer 0.2.5 %c eplayer.js.org \n', | ||
'color: #fff; background: linear-gradient(to right,#57a1fc ,#6beaf7); padding:5px;', | ||
'color: #7192c3; background: #ecfaff; padding:5px 0;' | ||
) | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1136115
13
1773
3
7
2