eplayer 1.6.9 → 1.6.10

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
@@ -21,7 +21,7 @@ class Eplayer extends HTMLElement {
21
21
  }
22
22
 
23
23
  static get observedAttributes() {
24
- return ['src', 'type', 'danma', 'live']
24
+ return ['src', 'type', 'danma', 'live','cover']
25
25
  }
26
26
 
27
27
  attributeChangedCallback(name, oldVal, newVal) {
@@ -52,6 +52,8 @@ class Eplayer extends HTMLElement {
52
52
  }
53
53
  if (name === 'cover') {
54
54
  this.cover = newVal
55
+ this.$('.rotate-img').setAttribute('src', newVal)
56
+ this.$('.cover').style.background=`url(${newVal || ''}) center/cover no-repeat #fff`
55
57
  }
56
58
  }
57
59
 
@@ -94,13 +96,13 @@ class Eplayer extends HTMLElement {
94
96
  if (this.video.paused) {
95
97
  this.video.play()
96
98
  this.danmaku.resume()
97
- this.$('.img-container').classList.add('is-playing');
99
+ this.$('.img-container').classList.add('is-playing')
98
100
  this.$('.is-play').setAttribute('icon-id', 'pause')
99
101
  this.emit('play')
100
102
  } else {
101
103
  this.video.pause()
102
104
  this.danmaku.pause()
103
- this.$('.img-container').classList.remove('is-playing');
105
+ this.$('.img-container').classList.remove('is-playing')
104
106
  this.$('.is-play').setAttribute('icon-id', 'play')
105
107
  this.emit('pause')
106
108
  }
@@ -669,7 +671,9 @@ class Eplayer extends HTMLElement {
669
671
  '.speed',
670
672
  '.pip',
671
673
  '.danmaku',
672
- '.speed-indicator'
674
+ '.speed-indicator',
675
+ '.rotate-img',
676
+ '.cover'
673
677
  ]
674
678
 
675
679
  for (const key of doms) {
package/docs/index.html CHANGED
@@ -66,7 +66,7 @@
66
66
  <div class="wrapper">
67
67
  <e-player id="ep"
68
68
  src="https://aod.cos.tx.xmcdn.com/storages/9976-audiofreehighqps/C9/1C/GAqhF9kMsE7kACAAAAQZZzo_.wav"
69
- cover="https://dd-static.jd.com/ddimgp/jfs/t20261103/331442/3/18576/2295463/68da8cdcF3f9f05fd/790caba1cab6753d.png">
69
+ >
70
70
  </e-player>
71
71
  </div>
72
72
  <script src="https://unpkg.com/@webcomponents/webcomponentsjs"></script>
@@ -98,7 +98,13 @@
98
98
  }
99
99
  }
100
100
 
101
- init()
101
+ setTimeout(() => {
102
+ console.log(123)
103
+ document.querySelector('e-player').setAttribute('cover','https://dd-static.jd.com/ddimgp/jfs/t20261103/331442/3/18576/2295463/68da8cdcF3f9f05fd/790caba1cab6753d.png')
104
+
105
+ }, 200);
106
+
107
+ // init()
102
108
  </script>
103
109
  <!-- <script src="./pic.js"></script> -->
104
110
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eplayer",
3
- "version": "1.6.9",
3
+ "version": "1.6.10",
4
4
  "description": "A web-components html5 video player facing future",
5
5
  "main": "./docs/eplayer.js",
6
6
  "module": "./docs/eplayer.js",