eplayer 1.5.7 → 1.5.9
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 +6 -3
- package/docs/index.html +3 -1
- package/package.json +1 -1
package/docs/eplayer.js
CHANGED
|
@@ -12,13 +12,14 @@ class Eplayer extends HTMLElement {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
static get observedAttributes() {
|
|
15
|
-
return ['src', 'type', 'beatmap']
|
|
15
|
+
return ['src', 'type', 'beatmap', 'height']
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
attributeChangedCallback(name, _, newVal) {
|
|
19
19
|
if (name === 'src') this.src = this.$('.video').src = newVal
|
|
20
20
|
if (name === 'type') this.type = newVal
|
|
21
21
|
if (name === 'beatmap') this.beatmap = newVal
|
|
22
|
+
if (name === 'height') this.height = newVal
|
|
22
23
|
this.stream()
|
|
23
24
|
this.startMug()
|
|
24
25
|
this.video.load()
|
|
@@ -35,7 +36,10 @@ class Eplayer extends HTMLElement {
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
startMug() {
|
|
39
|
+
this.$('.mug').innerHTML = '' // 先清空
|
|
38
40
|
this.$('.mug').style.display = 'block'
|
|
41
|
+
this.$('.mug').style.height = this.height + 'px'
|
|
42
|
+
this.$('.mug').style.width = (this.height / 8 * 5) + 'px'
|
|
39
43
|
this.$('.ep-video').style.display = 'none'
|
|
40
44
|
this.$('.controls').style.display = 'none'
|
|
41
45
|
if (!this.beatmap) return
|
|
@@ -436,7 +440,7 @@ class Eplayer extends HTMLElement {
|
|
|
436
440
|
}
|
|
437
441
|
.mug {
|
|
438
442
|
height: ${this.height}px;
|
|
439
|
-
width: ${this.height/8*5}px;
|
|
443
|
+
width: ${this.height / 8 * 5}px;
|
|
440
444
|
position: absolute;
|
|
441
445
|
z-index: 999;
|
|
442
446
|
/* pointer-events: none; */
|
|
@@ -448,7 +452,6 @@ class Eplayer extends HTMLElement {
|
|
|
448
452
|
}
|
|
449
453
|
.wrap{
|
|
450
454
|
position: relative;
|
|
451
|
-
// height: ${this.height}px;
|
|
452
455
|
}
|
|
453
456
|
</style>
|
|
454
457
|
<div class="wrap">
|
package/docs/index.html
CHANGED
|
@@ -102,12 +102,14 @@
|
|
|
102
102
|
</style>
|
|
103
103
|
<script>
|
|
104
104
|
setTimeout(() => {
|
|
105
|
+
document.querySelector('e-player').setAttribute('height', '450')
|
|
106
|
+
|
|
105
107
|
document.querySelector('e-player').setAttribute('beatmap', '1:2|2:1|3:3|4:4|6:2|6:1|7:3|8:4|8:2|9:1|11:3|12:4|12:2|13:1|14:3|15:4|16:2|16:1|17:3|19:4|19:2|20:1|21:3|22:4')
|
|
106
108
|
}, 1000)
|
|
107
109
|
</script>
|
|
108
110
|
<div class="wrapper">
|
|
109
111
|
|
|
110
|
-
<e-player id="ep" src="https://mp4.ziyuan.wang/view.php/67c796ed2dad70c429bda73a647704f0.mp4"
|
|
112
|
+
<e-player id="ep" src="https://mp4.ziyuan.wang/view.php/67c796ed2dad70c429bda73a647704f0.mp4">
|
|
111
113
|
</e-player>
|
|
112
114
|
|
|
113
115
|
<a href="https://github.com/132yse/eplayer">github</a>
|