eplayer 1.5.2 → 1.5.3

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
@@ -138,13 +138,13 @@ class Eplayer extends HTMLElement {
138
138
  case 38:
139
139
  try {
140
140
  this.video.volume = parseInt(this.video.volume * 100) / 100 + 0.05
141
- } catch (e) {}
141
+ } catch (e) { }
142
142
  setVolume(this.video.volume.toFixed(1) * 10, this.$('.line'))
143
143
  break
144
144
  case 40:
145
145
  try {
146
146
  this.video.volume = parseInt(this.video.volume * 100) / 100 - 0.05
147
- } catch (e) {}
147
+ } catch (e) { }
148
148
  setVolume(this.video.volume.toFixed(1) * 10, this.$('.line'))
149
149
  break
150
150
  case 32:
@@ -272,10 +272,11 @@ class Eplayer extends HTMLElement {
272
272
  }
273
273
  .lines{
274
274
  padding:0 10px;
275
+ display:flex;
276
+ align-items: center;
275
277
  }
276
278
  .line{
277
- padding:0;
278
- margin-bottom: -2px;
279
+ padding:0 2px;
279
280
  cursor:pointer
280
281
  }
281
282
  .line i{
@@ -565,7 +566,7 @@ class Eplayer extends HTMLElement {
565
566
  setVolume(index + 1, this.$('.line'))
566
567
  }
567
568
  })
568
- document.oncontextmenu = () => false
569
+ this.$('.eplayer').oncontextmenu = () => false
569
570
  }
570
571
  }
571
572
 
@@ -598,7 +599,7 @@ function isFullScreen() {
598
599
  return document.isFullScreen || document.webkitIsFullScreen || document.mozIsFullScreen
599
600
  }
600
601
 
601
- ;(function () {
602
+ ; (function () {
602
603
  let link = document.createElement('link')
603
604
  link.setAttribute('href', 'https://at.alicdn.com/t/font_836948_g9fk6jqpl8l.css')
604
605
  link.setAttribute('rel', 'stylesheet')
package/docs/index.html CHANGED
@@ -98,7 +98,7 @@
98
98
  </style>
99
99
  <div class="wrapper">
100
100
  <e-player id="ep"
101
- src="https://gss3.baidu.com/6LZ0ej3k1Qd3ote6lo7D0j9wehsv/tieba-smallvideo/3_d97abb65fc36a1d689efd3a105bebce1.mp4">
101
+ src="https://bos.nj.bpc.baidu.com/tieba-movideo/347573243_f2740215c9863213a9f272b81aab1b90_8b216f814f25.mp4">
102
102
  </e-player>
103
103
  <a href="https://github.com/132yse/eplayer">github</a>
104
104
  <a href="https://github.com/132yse/eplayer/blob/master/README.md">README</a>
@@ -110,4 +110,4 @@
110
110
  <script src="./pic.js"></script>
111
111
  </body>
112
112
 
113
- </html>
113
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eplayer",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "A web-components html5 video player facing future",
5
5
  "main": "./packages/eplayer/index.js",
6
6
  "module": "./packages/eplayer/index.js",
@@ -159,18 +159,11 @@ export default class Eplayer extends HTMLElement {
159
159
  }
160
160
 
161
161
  full() {
162
+ let el = this.$('.eplayer')
162
163
  if (isFullScreen()) {
163
- if (document.exitFullscreen) {
164
- document.exitFullscreen()
165
- } else if (document.mozCancelFullScreen) {
166
- document.mozCancelFullScreen()
167
- } else if (document.webkitCancelFullScreen) {
168
- document.webkitCancelFullScreen()
169
- } else if (document.msExitFullscreen) {
170
- document.msExitFullscreen()
171
- }
164
+ const efs = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen
165
+ return efs()
172
166
  } else {
173
- let el = this.$('.eplayer')
174
167
  let rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen
175
168
  return rfs.call(el)
176
169
  }
@@ -272,15 +265,15 @@ export default class Eplayer extends HTMLElement {
272
265
  }
273
266
  .lines{
274
267
  padding:0 10px;
268
+ display:flex;
269
+ align-items: center;
275
270
  }
276
271
  .line{
277
- padding:0;
278
- margin-bottom: -2px;
272
+ padding:0 0.1rem;
279
273
  cursor:pointer
280
274
  }
281
275
  .line i{
282
276
  width:4px;
283
- border-radius:4px;
284
277
  display: inline-block;
285
278
  background: var(--icons,rgba(255,255,255,0.6));
286
279
  height: 12px;
@@ -565,7 +558,7 @@ export default class Eplayer extends HTMLElement {
565
558
  setVolume(index + 1, this.$('.line'))
566
559
  }
567
560
  })
568
- document.oncontextmenu = () => false
561
+ this.$('.eplayer').oncontextmenu = () => false
569
562
  }
570
563
  }
571
564