From 66f77f63437c6774acbd72584a9839a7636ea167 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Wed, 5 May 2021 22:25:37 +0200 Subject: server: fix HLS playlist format Remove prefixed comma when there's no video codec. --- server/lib/hls.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'server/lib') diff --git a/server/lib/hls.ts b/server/lib/hls.ts index 84539e2c1..05be403f3 100644 --- a/server/lib/hls.ts +++ b/server/lib/hls.ts @@ -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)) -- cgit v1.2.3