eplayer 1.5.10 → 1.5.12

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
@@ -92,11 +92,11 @@ class Eplayer extends HTMLElement {
92
92
  volume() {
93
93
  if (this.video.muted) {
94
94
  this.video.muted = false
95
- setVolume(this.video.volume * 10, this.$('.line'))
95
+
96
96
  this.$('.is-volume').classList.replace('ep-volume-off', 'ep-volume')
97
97
  } else {
98
98
  this.video.muted = true
99
- setVolume(0, this.$('.line'))
99
+
100
100
  this.$('.is-volume').classList.replace('ep-volume', 'ep-volume-off')
101
101
  }
102
102
  }
@@ -119,10 +119,10 @@ class Eplayer extends HTMLElement {
119
119
 
120
120
  down(e) {
121
121
  this.disX = e.clientX - this.$('.cycle').offsetLeft
122
- document.onmousemove = (e) => this.move(e)
123
- document.onmouseup = () => {
124
- document.onmousemove = null
125
- document.onmouseup = null
122
+ document.onpointermove = (e) => this.move(e)
123
+ document.onpointerup = () => {
124
+ document.onpointermove = null
125
+ document.onpointerup = null
126
126
  }
127
127
  }
128
128
 
@@ -134,8 +134,8 @@ class Eplayer extends HTMLElement {
134
134
  }
135
135
  this.$('.current').style.width = offset + 'px'
136
136
  this.video.currentTime = (offset / this.$('.progress').clientWidth) * this.video.duration
137
- document.onmousemove = null
138
- setTimeout((document.onmousemove = (e) => e && this.move(e)), 30)
137
+ document.onpointermove = null
138
+ setTimeout((document.onpointermove = (e) => e && this.move(e)), 30)
139
139
  }
140
140
 
141
141
  alow() {
@@ -162,13 +162,11 @@ class Eplayer extends HTMLElement {
162
162
  try {
163
163
  this.video.volume = parseInt(this.video.volume * 100) / 100 + 0.05
164
164
  } catch (e) { }
165
- setVolume(this.video.volume.toFixed(1) * 10, this.$('.line'))
166
165
  break
167
166
  case 40:
168
167
  try {
169
168
  this.video.volume = parseInt(this.video.volume * 100) / 100 - 0.05
170
169
  } catch (e) { }
171
- setVolume(this.video.volume.toFixed(1) * 10, this.$('.line'))
172
170
  break
173
171
  case 32:
174
172
  this.play()
@@ -192,10 +190,13 @@ class Eplayer extends HTMLElement {
192
190
  } else if (document.msExitFullscreen) {
193
191
  document.msExitFullscreen()
194
192
  }
193
+
194
+ screen.orientation.lock("portrait-primary")
195
195
  } else {
196
196
  let el = this.$('.eplayer')
197
197
  let rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen
198
- return rfs.call(el)
198
+ rfs.call(el)
199
+ screen.orientation.lock("landscape-primary")
199
200
  }
200
201
  }
201
202
 
@@ -234,7 +235,7 @@ class Eplayer extends HTMLElement {
234
235
  // console.log(this.beatmap)
235
236
  let html = `
236
237
  <style>
237
- @import "https://at.alicdn.com/t/font_836948_g9fk6jqpl8l.css";
238
+ @import "https://at.alicdn.com/t/c/font_836948_ro9xopmggai.css";
238
239
  *{
239
240
  padding:0;
240
241
  margin:0;
@@ -461,7 +462,7 @@ class Eplayer extends HTMLElement {
461
462
  <div class="eplayer">
462
463
  <video id="video" class="video" src="${this.src || ''}"></video>
463
464
  <div class="mark loading"></div>
464
- <div class="controls" style="bottom:-50px">
465
+ <div class="controls" style="bottom:-70px">
465
466
  <div class="progress">
466
467
  <b class="bg"></b>
467
468
  <b class="buffer"></b>
@@ -479,18 +480,6 @@ class Eplayer extends HTMLElement {
479
480
  </div>
480
481
  <div class="right">
481
482
  <i class="epicon ep-volume is-volume"></i>
482
- <ol class="lines">
483
- <span class="line"><i></i></span>
484
- <span class="line"><i></i></span>
485
- <span class="line"><i></i></span>
486
- <span class="line"><i></i></span>
487
- <span class="line"><i></i></span>
488
- <span class="line"><i></i></span>
489
- <span class="line"><i></i></span>
490
- <span class="line"><i></i></span>
491
- <span class="line"><i></i></span>
492
- <span class="line"><i></i></span>
493
- </ol>
494
483
  <i class="epicon ep-speed">
495
484
  <b class="speed">1x</b>
496
485
  </i>
@@ -578,7 +567,7 @@ class Eplayer extends HTMLElement {
578
567
  this.video = this.$('.video')
579
568
  this.mug = this.$('.mug')
580
569
  this.video.volume = 0.5
581
- setVolume(this.video.volume * 10, this.$('.line'))
570
+ // setVolume(this.video.volume * 10, this.$('.line'))
582
571
  this.video.onwaiting = this.waiting.bind(this)
583
572
  this.video.oncanplay = this.canplay.bind(this)
584
573
  this.video.ontimeupdate = this.update.bind(this)
@@ -594,7 +583,7 @@ class Eplayer extends HTMLElement {
594
583
  '.buffer': this.progress,
595
584
  '.ep-pip': this.pip,
596
585
  })
597
- this.delegate('mousedown', {
586
+ this.delegate('pointerdown', {
598
587
  '.cycle': this.down,
599
588
  '.mark': this.panel,
600
589
  })
@@ -605,13 +594,7 @@ class Eplayer extends HTMLElement {
605
594
  },
606
595
  })
607
596
  this.delegate('keydown', this.keydown)
608
- this.delegate('mousemove', this.alow)
609
- this.$('.line').forEach((item, index) => {
610
- item.onclick = () => {
611
- this.video.volume = (index + 1) / 10
612
- setVolume(index + 1, this.$('.line'))
613
- }
614
- })
597
+ this.delegate('pointerdown', this.alow)
615
598
  this.$('.eplayer').oncontextmenu = () => false
616
599
  }
617
600
  }
@@ -632,15 +615,6 @@ function getTimeStr(time) {
632
615
  return h === '00' ? m + ':' + s : h + ':' + m + ':' + s
633
616
  }
634
617
 
635
- function setVolume(index, node) {
636
- for (let j = index; j < node.length; j++) {
637
- node[j].classList.remove('active')
638
- }
639
- for (let i = 0; i < index; i++) {
640
- node[i].classList.add('active')
641
- }
642
- }
643
-
644
618
  function isFullScreen() {
645
619
  return document.isFullScreen || document.webkitIsFullScreen || document.mozIsFullScreen
646
620
  }
package/docs/index.html CHANGED
@@ -27,8 +27,7 @@
27
27
  @media screen and (max-width: 500px) {
28
28
  .wrapper {
29
29
  width: 100%;
30
- margin: 100px auto;
31
- max-height: 200px;
30
+ transform: translate(-50%, 0)!important;
32
31
  }
33
32
  }
34
33
 
@@ -109,7 +108,7 @@
109
108
  </script>
110
109
  <div class="wrapper">
111
110
 
112
- <e-player id="ep" src="https://mp4.ziyuan.wang/view.php/67c796ed2dad70c429bda73a647704f0.mp4">
111
+ <e-player id="ep" src="https://a1.alibabausercontent.com/prod/feupload/user/edos8/2f0e7af0-29f1-11ef-b3cd-818e64ac843d.mp4">
113
112
  </e-player>
114
113
 
115
114
  <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.10",
3
+ "version": "1.5.12",
4
4
  "description": "A web-components html5 video player facing future",
5
5
  "main": "./docs/eplayer.js",
6
6
  "module": "./docs/eplayer.js",