eplayer 1.5.13 → 1.5.15
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 +16 -5
- package/docs/index.html +6 -2
- package/package.json +1 -1
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,17 @@ 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')
|
|
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
|
+
}else{
|
|
30
|
+
this.$('.progress').style.display = 'block'
|
|
31
|
+
this.$('.time').style.display = 'inline-block'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
this.stream()
|
|
26
36
|
this.startMug()
|
|
27
37
|
this.video.load()
|
|
@@ -192,7 +202,7 @@ class Eplayer extends HTMLElement {
|
|
|
192
202
|
} else if (document.msExitFullscreen) {
|
|
193
203
|
document.msExitFullscreen()
|
|
194
204
|
}
|
|
195
|
-
|
|
205
|
+
|
|
196
206
|
screen.orientation.lock("portrait-primary")
|
|
197
207
|
} else {
|
|
198
208
|
let el = this.$('.eplayer')
|
|
@@ -269,7 +279,7 @@ class Eplayer extends HTMLElement {
|
|
|
269
279
|
z-index:1;
|
|
270
280
|
}
|
|
271
281
|
.progress{
|
|
272
|
-
display:${this.live?'none':'block'};
|
|
282
|
+
display:${this.live ? 'none' : 'block'};
|
|
273
283
|
position:relative;
|
|
274
284
|
bottom:15px;
|
|
275
285
|
left:0;
|
|
@@ -293,7 +303,7 @@ class Eplayer extends HTMLElement {
|
|
|
293
303
|
color:#fff;
|
|
294
304
|
}
|
|
295
305
|
.time{
|
|
296
|
-
display:${this.live?'none':'inline-block'};
|
|
306
|
+
display:${this.live ? 'none' : 'inline-block'};
|
|
297
307
|
position:relative;
|
|
298
308
|
top:-2px;
|
|
299
309
|
}
|
|
@@ -510,6 +520,7 @@ class Eplayer extends HTMLElement {
|
|
|
510
520
|
'.loading',
|
|
511
521
|
'.total',
|
|
512
522
|
'.now',
|
|
523
|
+
'.time',
|
|
513
524
|
'.current',
|
|
514
525
|
'.buffer',
|
|
515
526
|
'.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
|
|