X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fhls.ts;h=053b5d3262f50f59fc9307e158690a87e97cb4af;hb=60b880acdfa85eab5c9ec09ba1283f82ae58ec85;hp=a41f1ae4858461e17ed22047b3e44d11e0bd8a56;hpb=b1dbb9fefc870a90b25f5c0153589f45c9e75e3e;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 } // ---------------------------------------------------------------------------