aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r--shared/extra-utils/videos/video-streaming-playlists.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/shared/extra-utils/videos/video-streaming-playlists.ts b/shared/extra-utils/videos/video-streaming-playlists.ts
index 8cf0e4930..b386e77c3 100644
--- a/shared/extra-utils/videos/video-streaming-playlists.ts
+++ b/shared/extra-utils/videos/video-streaming-playlists.ts
@@ -41,6 +41,20 @@ async function checkSegmentHash (
41 expect(sha256(res2.body)).to.equal(sha256Server) 41 expect(sha256(res2.body)).to.equal(sha256Server)
42} 42}
43 43
44async function checkLiveSegmentHash (
45 baseUrlSegment: string,
46 videoUUID: string,
47 segmentName: string,
48 hlsPlaylist: VideoStreamingPlaylist
49) {
50 const res2 = await getSegment(`${baseUrlSegment}/${videoUUID}/${segmentName}`)
51
52 const resSha = await getSegmentSha256(hlsPlaylist.segmentsSha256Url)
53
54 const sha256Server = resSha.body[segmentName]
55 expect(sha256(res2.body)).to.equal(sha256Server)
56}
57
44async function checkResolutionsInMasterPlaylist (playlistUrl: string, resolutions: number[]) { 58async function checkResolutionsInMasterPlaylist (playlistUrl: string, resolutions: number[]) {
45 const res = await getPlaylist(playlistUrl) 59 const res = await getPlaylist(playlistUrl)
46 60
@@ -62,5 +76,6 @@ export {
62 getSegment, 76 getSegment,
63 checkResolutionsInMasterPlaylist, 77 checkResolutionsInMasterPlaylist,
64 getSegmentSha256, 78 getSegmentSha256,
79 checkLiveSegmentHash,
65 checkSegmentHash 80 checkSegmentHash
66} 81}