diff options
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r-- | shared/extra-utils/videos/video-streaming-playlists.ts | 15 |
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 e54da84aa..8cf0e4930 100644 --- a/shared/extra-utils/videos/video-streaming-playlists.ts +++ b/shared/extra-utils/videos/video-streaming-playlists.ts | |||
@@ -41,11 +41,26 @@ async function checkSegmentHash ( | |||
41 | expect(sha256(res2.body)).to.equal(sha256Server) | 41 | expect(sha256(res2.body)).to.equal(sha256Server) |
42 | } | 42 | } |
43 | 43 | ||
44 | async function checkResolutionsInMasterPlaylist (playlistUrl: string, resolutions: number[]) { | ||
45 | const res = await getPlaylist(playlistUrl) | ||
46 | |||
47 | const masterPlaylist = res.text | ||
48 | |||
49 | for (const resolution of resolutions) { | ||
50 | const reg = new RegExp( | ||
51 | '#EXT-X-STREAM-INF:BANDWIDTH=\\d+,RESOLUTION=\\d+x' + resolution + ',(FRAME-RATE=\\d+,)?CODECS="avc1.64001f,mp4a.40.2"' | ||
52 | ) | ||
53 | |||
54 | expect(masterPlaylist).to.match(reg) | ||
55 | } | ||
56 | } | ||
57 | |||
44 | // --------------------------------------------------------------------------- | 58 | // --------------------------------------------------------------------------- |
45 | 59 | ||
46 | export { | 60 | export { |
47 | getPlaylist, | 61 | getPlaylist, |
48 | getSegment, | 62 | getSegment, |
63 | checkResolutionsInMasterPlaylist, | ||
49 | getSegmentSha256, | 64 | getSegmentSha256, |
50 | checkSegmentHash | 65 | checkSegmentHash |
51 | } | 66 | } |