eplayer 1.6.3 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/eplayer.js +26 -8
- package/package.json +1 -1
package/docs/eplayer.js
CHANGED
|
@@ -100,6 +100,7 @@ class Eplayer extends HTMLElement {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
update() {
|
|
103
|
+
if (this.moving) return
|
|
103
104
|
let cTime = getTimeStr(this.video.currentTime)
|
|
104
105
|
if (this.video.buffered.length) {
|
|
105
106
|
let bufferEnd = this.video.buffered.end(this.video.buffered.length - 1)
|
|
@@ -116,19 +117,21 @@ class Eplayer extends HTMLElement {
|
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
down(e) {
|
|
119
|
-
this.disX = e.clientX - this.$('.
|
|
120
|
+
this.disX = e.clientX - this.$('.dot').offsetLeft
|
|
121
|
+
this.moving = true
|
|
120
122
|
document.onpointermove = (e) => this.move(e)
|
|
121
123
|
document.onpointerup = () => {
|
|
124
|
+
this.moveing = false
|
|
122
125
|
document.onpointermove = null
|
|
123
126
|
document.onpointerup = null
|
|
124
127
|
}
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
move(e) {
|
|
128
|
-
let offset = e.clientX - this.disX +
|
|
131
|
+
let offset = e.clientX - this.disX + 12
|
|
129
132
|
if (offset < 0) offset = 0
|
|
130
133
|
if (offset > this.$('.progress').clientWidth) {
|
|
131
|
-
offset = this.$('.progress').clientWidth
|
|
134
|
+
this.offset = this.$('.progress').clientWidth
|
|
132
135
|
}
|
|
133
136
|
this.$('.current').style.width = offset + 'px'
|
|
134
137
|
this.video.currentTime = (offset / this.$('.progress').clientWidth) * this.video.duration
|
|
@@ -137,8 +140,13 @@ class Eplayer extends HTMLElement {
|
|
|
137
140
|
}
|
|
138
141
|
|
|
139
142
|
alow() {
|
|
140
|
-
|
|
143
|
+
console.log(111)
|
|
144
|
+
clearTimeout(this.timer)
|
|
141
145
|
this.$('.mark').style.cursor = 'default'
|
|
146
|
+
this.timer = setTimeout(() => {
|
|
147
|
+
this.$('.controls').style.bottom = -34 + 'px'
|
|
148
|
+
this.$('.mark').style.cursor = 'none'
|
|
149
|
+
}, 5000)
|
|
142
150
|
}
|
|
143
151
|
|
|
144
152
|
keydown(e) {
|
|
@@ -258,6 +266,9 @@ class Eplayer extends HTMLElement {
|
|
|
258
266
|
}
|
|
259
267
|
.eplayer:hover .controls{
|
|
260
268
|
bottom:0;
|
|
269
|
+
animation: hidden 0s ease-in 5s forwards;
|
|
270
|
+
animation-fill-mode: forwards;
|
|
271
|
+
transition: .3s ease-out;
|
|
261
272
|
}
|
|
262
273
|
.progress{
|
|
263
274
|
display:${this.live ? 'none' : 'block'};
|
|
@@ -271,7 +282,7 @@ class Eplayer extends HTMLElement {
|
|
|
271
282
|
.progress:hover .bg,.progress:hover .current,.progress:hover .buffer{
|
|
272
283
|
height:6px;
|
|
273
284
|
}
|
|
274
|
-
.progress:hover .dot
|
|
285
|
+
.progress:hover .dot{
|
|
275
286
|
display:block;
|
|
276
287
|
}
|
|
277
288
|
.options{
|
|
@@ -323,6 +334,13 @@ class Eplayer extends HTMLElement {
|
|
|
323
334
|
transform: translate(50%,0);
|
|
324
335
|
cursor:pointer;
|
|
325
336
|
z-index:1;
|
|
337
|
+
}
|
|
338
|
+
@keyframes hidden {
|
|
339
|
+
to {
|
|
340
|
+
|
|
341
|
+
transition: .3s ease-out;
|
|
342
|
+
bottom:-34px;
|
|
343
|
+
}
|
|
326
344
|
}
|
|
327
345
|
@keyframes loading{
|
|
328
346
|
0%{
|
|
@@ -455,7 +473,7 @@ class Eplayer extends HTMLElement {
|
|
|
455
473
|
'.buffer',
|
|
456
474
|
'.is-play',
|
|
457
475
|
'.is-volume',
|
|
458
|
-
'.
|
|
476
|
+
'.dot',
|
|
459
477
|
'.progress',
|
|
460
478
|
'.controls',
|
|
461
479
|
'.line',
|
|
@@ -506,7 +524,7 @@ class Eplayer extends HTMLElement {
|
|
|
506
524
|
'.pip': this.pip,
|
|
507
525
|
})
|
|
508
526
|
this.delegate('pointerdown', {
|
|
509
|
-
'.
|
|
527
|
+
'.dot': this.down,
|
|
510
528
|
'.mark': this.panel,
|
|
511
529
|
})
|
|
512
530
|
this.delegate('dblclick', {
|
|
@@ -516,7 +534,7 @@ class Eplayer extends HTMLElement {
|
|
|
516
534
|
},
|
|
517
535
|
})
|
|
518
536
|
this.delegate('keydown', this.keydown)
|
|
519
|
-
this.delegate('
|
|
537
|
+
this.delegate('mouseleave', this.alow)
|
|
520
538
|
this.$('.eplayer').oncontextmenu = () => false
|
|
521
539
|
}
|
|
522
540
|
|