From d97d36b486847689f6089a6877afc70ba4123e80 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 28 Dec 2022 16:30:34 +0100 Subject: More robust player stats card --- client/src/assets/player/shared/stats/stats-card.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/assets') diff --git a/client/src/assets/player/shared/stats/stats-card.ts b/client/src/assets/player/shared/stats/stats-card.ts index f23ae48be..471a5e46c 100644 --- a/client/src/assets/player/shared/stats/stats-card.ts +++ b/client/src/assets/player/shared/stats/stats-card.ts @@ -182,7 +182,7 @@ class StatsCard extends Component { let colorSpace = 'unknown' let codecs = 'unknown' - if (metadata?.streams[0]) { + if (metadata?.streams?.[0]) { const stream = metadata.streams[0] colorSpace = stream['color_space'] !== 'unknown' @@ -193,7 +193,7 @@ class StatsCard extends Component { } const resolution = videoFile?.resolution.label + videoFile?.fps - const buffer = this.timeRangesToString(this.player().buffered()) + const buffer = this.timeRangesToString(this.player_.buffered()) const progress = this.player_.webtorrent().getTorrent()?.progress return { -- cgit v1.2.3