eplayer 1.5.12 → 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
@@ -6,13 +6,14 @@ class Eplayer extends HTMLElement {
6
6
  this.type = this.getAttribute('type')
7
7
  this.beatmap = this.getAttribute('beatmap')
8
8
  this.height = this.getAttribute('height')
9
+ this.live = JSON.parse(this.getAttribute('live'))
9
10
 
10
11
  this.init()
11
12
  this.stream()
12
13
  }
13
14
 
14
15
  static get observedAttributes() {
15
- return ['src', 'type', 'beatmap', 'height']
16
+ return ['src', 'type', 'beatmap', 'height', 'live']
16
17
  }
17
18
 
18
19
  attributeChangedCallback(name, _, newVal) {
@@ -20,6 +21,14 @@ class Eplayer extends HTMLElement {
20
21
  if (name === 'type') this.type = newVal
21
22
  if (name === 'beatmap') this.beatmap = newVal
22
23
  if (name === 'height') this.height = 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
+
23
32
  this.stream()
24
33
  this.startMug()
25
34
  this.video.load()
@@ -190,7 +199,7 @@ class Eplayer extends HTMLElement {
190
199
  } else if (document.msExitFullscreen) {
191
200
  document.msExitFullscreen()
192
201
  }
193
-
202
+
194
203
  screen.orientation.lock("portrait-primary")
195
204
  } else {
196
205
  let el = this.$('.eplayer')
@@ -267,6 +276,7 @@ class Eplayer extends HTMLElement {
267
276
  z-index:1;
268
277
  }
269
278
  .progress{
279
+ display:${this.live ? 'none' : 'block'};
270
280
  position:relative;
271
281
  bottom:15px;
272
282
  left:0;
@@ -290,6 +300,7 @@ class Eplayer extends HTMLElement {
290
300
  color:#fff;
291
301
  }
292
302
  .time{
303
+ display:${this.live ? 'none' : 'inline-block'};
293
304
  position:relative;
294
305
  top:-2px;
295
306
  }
@@ -506,6 +517,7 @@ class Eplayer extends HTMLElement {
506
517
  '.loading',
507
518
  '.total',
508
519
  '.now',
520
+ '.time',
509
521
  '.current',
510
522
  '.buffer',
511
523
  '.is-play',
package/docs/index.html CHANGED
@@ -108,7 +108,8 @@
108
108
  </script>
109
109
  <div class="wrapper">
110
110
 
111
- <e-player id="ep" src="https://a1.alibabausercontent.com/prod/feupload/user/edos8/2f0e7af0-29f1-11ef-b3cd-818e64ac843d.mp4">
111
+ <e-player id="ep"
112
+ src="https://a1.alibabausercontent.com/prod/feupload/user/edos8/2f0e7af0-29f1-11ef-b3cd-818e64ac843d.mp4">
112
113
  </e-player>
113
114
 
114
115
  <a href="https://github.com/132yse/eplayer">github</a>
@@ -118,6 +119,11 @@
118
119
  <script src="https://unpkg.com/@webcomponents/webcomponentsjs"></script>
119
120
  <script src="https://unpkg.com/hls.js"></script>
120
121
  <script src="./eplayer.js"></script>
122
+ <script>
123
+ setTimeout(() => {
124
+ document.querySelector('e-player').setAttribute('live',true)
125
+ }, 1000);
126
+ </script>
121
127
  <!-- <script src="./pic.js"></script> -->
122
128
  </body>
123
129
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eplayer",
3
- "version": "1.5.12",
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",