Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/renderer/helpers/player/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import shaka from 'shaka-player'
import { deepCopy } from '../utils'
import i18n from '../../i18n/index'
import { sponsorBlockSkipSegments } from '../sponsorblock'

Expand All @@ -26,7 +25,7 @@ export function logShakaError(error, context, videoId, details) {
const codeText = Object.keys(Code).find((/** @type {keyof Code} */ key) => Code[key] === error.code)

const message =
'Player Error (category and code explainations here: https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html)\n' +
`Player Error (category and code explainations here: https://shaka-project.github.io/shaka-player/docs/api/shaka.util.Error.html#value%3A${error.code})\n` +
`Video ID: "${videoId}"\n` +
`FreeTube player context: "${context}"\n\n` +
`Severity: ${severityText} (${error.severity})\n` +
Expand All @@ -40,17 +39,14 @@ export function logShakaError(error, context, videoId, details) {
if (error.data && error.data.length > 0) {
args.push(
'\n\nshaka-player Data:',
error.data
JSON.stringify(error.data)
)
}

if (details) {
args.push(
'\n\nFreeTube data:',
// use deepCopy to get rid of Vue's proxying,
// as that requires you click the 3 dots for every property in the logged object to see their values
// doing it like this, results in a "clean" object where everything is immediately visible
typeof details === 'object' ? deepCopy(details) : details
typeof details === 'object' ? JSON.stringify(details) : details
)
}

Expand Down
Loading