ad6ff774 by mrocajr Committed by Brandon Casey

Made properties of hls.stats enumerable. (#769)

* Properties of stats enumerable and consolidated them into defineProperties
1 parent 73540062
...@@ -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',
......