]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/stats/stats-card.ts
Merge branch 'release/3.3.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / stats / stats-card.ts
index d9f0d2fe9deab25051e0f8ffeb82a957d1672ee5..b271d052660fb129039ef5c82037a2e84e7e55df 100644 (file)
@@ -1,6 +1,7 @@
 import videojs from 'video.js'
+import { secondsToTime } from '@shared/core-utils'
 import { PlayerNetworkInfo as EventPlayerNetworkInfo } from '../peertube-videojs-typings'
-import { bytes, secondsToTime } from '../utils'
+import { bytes } from '../utils'
 
 interface StatsCardOptions extends videojs.ComponentOptions {
   videoUUID: string
@@ -89,9 +90,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) {
@@ -212,7 +213,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)}