eplayer 1.5.13 → 1.5.14

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
@@ -13,7 +13,7 @@ class Eplayer extends HTMLElement {
13
13
  }
14
14
 
15
15
  static get observedAttributes() {
16
- return ['src', 'type', 'beatmap', 'height','live']
16
+ return ['src', 'type', 'beatmap', 'height', 'live']
17
17
  }
18
18
 
19
19
  attributeChangedCallback(name, _, newVal) {
@@ -21,7 +21,14 @@ class Eplayer extends HTMLElement {
21
21
  if (name === 'type') this.type = newVal
22
22
  if (name === 'beatmap') this.beatmap = newVal
23
23
  if (name === 'height') this.height = newVal
24
- if (name === 'live') this.live = JSON.parse(newVal)
24
+ if (name === 'live') {
25
+ this.live = JSON.parse(newVal)
26
+ if (this.live) {
27
+ this.$('.progress').style.display = 'none'
28
+ this.$('.time').style.display = 'none'
29
+ }
30
+ }
31
+
25
32
  this.stream()
26
33
  this.startMug()
27
34
  this.video.load()
@@ -192,7 +199,7 @@ class Eplayer extends HTMLElement {
192
199
  } else if (document.msExitFullscreen) {
193
200
  document.msExitFullscreen()
194
201
  }
195
-
202
+
196
203
  screen.orientation.lock("portrait-primary")
197
204
  } else {
198
205
  let el = this.$('.eplayer')
@@ -269,7 +276,7 @@ class Eplayer extends HTMLElement {
269
276
  z-index:1;
270
277
  }
271
278
  .progress{
272
- display:${this.live?'none':'block'};
279
+ display:${this.live ? 'none' : 'block'};
273
280
  position:relative;
274
281
  bottom:15px;
275
282
  left:0;
@@ -293,7 +300,7 @@ class Eplayer extends HTMLElement {
293
300
  color:#fff;
294
301
  }
295
302
  .time{
296
- display:${this.live?'none':'inline-block'};
303
+ display:${this.live ? 'none' : 'inline-block'};
297
304
  position:relative;
298
305
  top:-2px;
299
306
  }
@@ -510,6 +517,7 @@ class Eplayer extends HTMLElement {
510
517
  '.loading',
511
518
  '.total',
512
519
  '.now',
520
+ '.time',
513
521
  '.current',
514
522
  '.buffer',
515
523
  '.is-play',
package/docs/index.html CHANGED
@@ -109,8 +109,7 @@
109
109
  <div class="wrapper">
110
110
 
111
111
  <e-player id="ep"
112
- src="https://a1.alibabausercontent.com/prod/feupload/user/edos8/2f0e7af0-29f1-11ef-b3cd-818e64ac843d.mp4"
113
- live="false">
112
+ src="https://a1.alibabausercontent.com/prod/feupload/user/edos8/2f0e7af0-29f1-11ef-b3cd-818e64ac843d.mp4">
114
113
  </e-player>
115
114
 
116
115
  <a href="https://github.com/132yse/eplayer">github</a>
@@ -120,6 +119,11 @@
120
119
  <script src="https://unpkg.com/@webcomponents/webcomponentsjs"></script>
121
120
  <script src="https://unpkg.com/hls.js"></script>
122
121
  <script src="./eplayer.js"></script>
122
+ <script>
123
+ setTimeout(() => {
124
+ document.querySelector('e-player').setAttribute('live',true)
125
+ }, 1000);
126
+ </script>
123
127
  <!-- <script src="./pic.js"></script> -->
124
128
  </body>
125
129
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eplayer",
3
- "version": "1.5.13",
3
+ "version": "1.5.14",
4
4
  "description": "A web-components html5 video player facing future",
5
5
  "main": "./docs/eplayer.js",
6
6
  "module": "./docs/eplayer.js",