Made properties of hls.stats enumerable. (#769)
* Properties of stats enumerable and consolidated them into defineProperties
Showing
1 changed file
with
17 additions
and
11 deletions
... | @@ -409,17 +409,23 @@ class HlsHandler extends Component { | ... | @@ -409,17 +409,23 @@ class HlsHandler extends Component { |
409 | } | 409 | } |
410 | }); | 410 | }); |
411 | 411 | ||
412 | Object.defineProperty(this.stats, 'bandwidth', { | 412 | Object.defineProperties(this.stats, { |
413 | get: () => this.bandwidth || 0 | 413 | bandwidth: { |
414 | }); | 414 | get: () => this.bandwidth || 0, |
415 | Object.defineProperty(this.stats, 'mediaRequests', { | 415 | enumerable: true |
416 | get: () => this.masterPlaylistController_.mediaRequests_() || 0 | 416 | }, |
417 | }); | 417 | mediaRequests: { |
418 | Object.defineProperty(this.stats, 'mediaTransferDuration', { | 418 | get: () => this.masterPlaylistController_.mediaRequests_() || 0, |
419 | get: () => this.masterPlaylistController_.mediaTransferDuration_() || 0 | 419 | enumerable: true |
420 | }); | 420 | }, |
421 | Object.defineProperty(this.stats, 'mediaBytesTransferred', { | 421 | mediaTransferDuration: { |
422 | get: () => this.masterPlaylistController_.mediaBytesTransferred_() || 0 | 422 | get: () => this.masterPlaylistController_.mediaTransferDuration_() || 0, |
423 | enumerable: true | ||
424 | }, | ||
425 | mediaBytesTransferred: { | ||
426 | get: () => this.masterPlaylistController_.mediaBytesTransferred_() || 0, | ||
427 | enumerable: true | ||
428 | } | ||
423 | }); | 429 | }); |
424 | 430 | ||
425 | this.tech_.one('canplay', | 431 | this.tech_.one('canplay', | ... | ... |
-
Please register or sign in to post a comment