eplayer 1.5.6 → 1.5.8

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 CHANGED
@@ -5,20 +5,21 @@ class Eplayer extends HTMLElement {
5
5
  this.src = this.getAttribute('src')
6
6
  this.type = this.getAttribute('type')
7
7
  this.beatmap = this.getAttribute('beatmap')
8
- this.high = this.getAttribute('high')
8
+ this.height = this.getAttribute('height')
9
9
 
10
10
  this.init()
11
11
  this.stream()
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()
@@ -36,6 +37,8 @@ class Eplayer extends HTMLElement {
36
37
 
37
38
  startMug() {
38
39
  this.$('.mug').style.display = 'block'
40
+ this.$('.mug').style.height = this.height + 'px'
41
+ this.$('.mug').style.width = (this.height / 8 * 5) + 'px'
39
42
  this.$('.ep-video').style.display = 'none'
40
43
  this.$('.controls').style.display = 'none'
41
44
  if (!this.beatmap) return
@@ -435,8 +438,8 @@ class Eplayer extends HTMLElement {
435
438
  display:inline-block;
436
439
  }
437
440
  .mug {
438
- height: ${this.high}px;
439
- width: ${this.high/8*5}px;
441
+ height: ${this.height}px;
442
+ width: ${this.height / 8 * 5}px;
440
443
  position: absolute;
441
444
  z-index: 999;
442
445
  /* pointer-events: none; */
@@ -448,7 +451,6 @@ class Eplayer extends HTMLElement {
448
451
  }
449
452
  .wrap{
450
453
  position: relative;
451
- // height: ${this.high}px;
452
454
  }
453
455
  </style>
454
456
  <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" high="450">
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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eplayer",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "A web-components html5 video player facing future",
5
5
  "main": "./docs/eplayer.js",
6
6
  "module": "./docs/eplayer.js",