]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/stats/stats-card.ts
Fix console error when watching a video
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / stats / stats-card.ts
index 29163108841da83e3142783298ae400bd3b5b08e..a93f595062ac98f6e4ccd5e108af2467a67fc282 100644 (file)
@@ -89,9 +89,9 @@ class StatsCard extends Component {
     this.container.style.display = 'block'
     this.updateInterval = setInterval(async () => {
       try {
-        const options = this.mode === 'webtorrent'
-          ? await this.buildWebTorrentOptions()
-          : await this.buildHLSOptions()
+        const options = this.mode === 'p2p-media-loader'
+          ? await this.buildHLSOptions()
+          : await this.buildWebTorrentOptions() // Default
 
         this.list.innerHTML = this.getListTemplate(options)
       } catch (err) {
@@ -193,7 +193,7 @@ class StatsCard extends Component {
 
     const duration = player.duration()
 
-    let volume = `${player.volume() * 100}`
+    let volume = `${Math.round(player.volume() * 100)}`
     if (player.muted()) volume += ' (muted)'
 
     const networkActivity = playerNetworkInfo.downloadSpeed
@@ -212,7 +212,7 @@ class StatsCard extends Component {
       : undefined
 
     return `
-      ${this.buildElement(player.localize('Player mode'), this.options_.mode)}
+      ${this.buildElement(player.localize('Player mode'), this.mode || 'HTTP')}
 
       ${this.buildElement(player.localize('Video UUID'), this.options_.videoUUID)}