More robust player stats card

pull/5502/head
Chocobozzz 2022-12-28 16:30:34 +01:00
parent 0e08a5e749
commit d97d36b486
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 2 deletions

View File

@ -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 {