server: fix HLS playlist format
Remove prefixed comma when there's no video codec.
This commit is contained in:
parent
b31d72625d
commit
66f77f6343
|
@ -50,13 +50,12 @@ async function updateMasterHLSPlaylist (video: MVideoWithFile) {
|
||||||
let line = `#EXT-X-STREAM-INF:${bandwidth},${resolution}`
|
let line = `#EXT-X-STREAM-INF:${bandwidth},${resolution}`
|
||||||
if (file.fps) line += ',FRAME-RATE=' + file.fps
|
if (file.fps) line += ',FRAME-RATE=' + file.fps
|
||||||
|
|
||||||
const videoCodec = await getVideoStreamCodec(videoFilePath)
|
const codecs = await Promise.all([
|
||||||
line += `,CODECS="${videoCodec}`
|
getVideoStreamCodec(videoFilePath),
|
||||||
|
getAudioStreamCodec(videoFilePath)
|
||||||
|
])
|
||||||
|
|
||||||
const audioCodec = await getAudioStreamCodec(videoFilePath)
|
line += `,CODECS="${codecs.filter(c => !!c).join(',')}"`
|
||||||
if (audioCodec) line += `,${audioCodec}`
|
|
||||||
|
|
||||||
line += '"'
|
|
||||||
|
|
||||||
masterPlaylists.push(line)
|
masterPlaylists.push(line)
|
||||||
masterPlaylists.push(VideoStreamingPlaylistModel.getHlsPlaylistFilename(file.resolution))
|
masterPlaylists.push(VideoStreamingPlaylistModel.getHlsPlaylistFilename(file.resolution))
|
||||||
|
|
Loading…
Reference in New Issue