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