log hls variant playlist segments for resume debug
This commit is contained in:
@@ -367,10 +367,24 @@ export default function PlayerPage() {
|
||||
.then(r => r.text())
|
||||
.then(text => {
|
||||
const lines = text.split(/\r?\n/)
|
||||
const segmentLines = lines.filter(l => l.includes('.m3u8') || l.includes('.ts') || l.includes('m4s') || l.includes('.mp4'))
|
||||
console.log('[player] hls playlist first 12 lines', lines.slice(0, 12))
|
||||
console.log('[player] hls first 4 segment lines', segmentLines.slice(0, 4))
|
||||
console.log('[player] hls segments have runtimeTicks', segmentLines.some(l => l.includes('runtimeTicks=')))
|
||||
const variantLine = lines.find(l => l.endsWith('.m3u8') && !l.startsWith('#'))
|
||||
console.log('[player] hls master playlist', text)
|
||||
if (variantLine) {
|
||||
const variantUrl = variantLine.startsWith('http')
|
||||
? variantLine
|
||||
: new URL(variantLine, fullUrl).toString()
|
||||
return fetch(variantUrl, { headers: { Authorization: `MediaBrowser Token=${token}` } }).then(r => r.text())
|
||||
}
|
||||
return null
|
||||
})
|
||||
.then(variantText => {
|
||||
if (!variantText) return
|
||||
const lines = variantText.split(/\r?\n/)
|
||||
const segmentLines = lines.filter(l => /\.(ts|m4s|mp4)(\?|$)/.test(l))
|
||||
console.log('[player] hls variant playlist (first 20 lines)', lines.slice(0, 20))
|
||||
console.log('[player] hls variant first 6 segment lines', segmentLines.slice(0, 6))
|
||||
console.log('[player] hls variant segments have runtimeTicks', segmentLines.some(l => l.includes('runtimeTicks=')))
|
||||
console.log('[player] hls variant segments have StartTimeTicks', segmentLines.some(l => l.includes('StartTimeTicks=')))
|
||||
})
|
||||
.catch(e => console.warn('[player] hls playlist fetch failed', e))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user