X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fhls.ts;h=053b5d3262f50f59fc9307e158690a87e97cb4af;hb=35f6b17e6112e6ebf5030f91fa9aad0c33e07cfd;hp=a41f1ae4858461e17ed22047b3e44d11e0bd8a56;hpb=91a4893063402d7beabb3104f9b989b8f88b6038;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/hls.ts b/server/lib/hls.ts index a41f1ae48..053b5d326 100644 --- a/server/lib/hls.ts +++ b/server/lib/hls.ts @@ -234,13 +234,20 @@ function downloadPlaylistSegments (playlistUrl: string, destinationDir: string, // --------------------------------------------------------------------------- +function injectQueryToPlaylistUrls (content: string, queryString: string) { + return content.replace(/\.(m3u8|ts|mp4)/gm, '.$1?' + queryString) +} + +// --------------------------------------------------------------------------- + export { updateMasterHLSPlaylist, updateSha256VODSegments, buildSha256Segment, downloadPlaylistSegments, updateStreamingPlaylistsInfohashesIfNeeded, - updatePlaylistAfterFileChange + updatePlaylistAfterFileChange, + injectQueryToPlaylistUrls } // ---------------------------------------------------------------------------