@mpxjs/webpack-plugin 2.10.13-beta.2 → 2.10.13-beta.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.
@@ -148,6 +148,11 @@
148
148
  },
149
149
  controls: function (show) {
150
150
  this.$emit('controlstoggle', inheritEvent('controlstoggle', {}, { show }))
151
+ },
152
+ objectFit (val) {
153
+ if (this._player && this._player.video) {
154
+ this._player.video.style.objectFit = val
155
+ }
151
156
  }
152
157
  },
153
158
  mounted () {
@@ -189,6 +194,9 @@
189
194
  if (this.initialTime) {
190
195
  this._player.seek(this.initialTime)
191
196
  }
197
+ if (this.objectFit) {
198
+ this._player.video.style.objectFit = this.objectFit
199
+ }
192
200
  },
193
201
  initStyle () {
194
202
 
@@ -239,7 +247,10 @@
239
247
 
240
248
  this._player.on('progress', (e) => {
241
249
  const eNode = e.target
242
- const buffered = (eNode?.buffered?.end(0)) / (eNode?.duration)
250
+ let buffered = 0
251
+ if (eNode?.buffered && eNode.buffered.length > 0) {
252
+ buffered = (eNode.buffered.end(0)) / (eNode?.duration)
253
+ }
243
254
  this.$emit('progress', inheritEvent('progress', e, { buffered: buffered * 100 }))
244
255
  })
245
256
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.13-beta.2",
3
+ "version": "2.10.13-beta.3",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"