aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-04 15:31:32 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commitbd54ad1953ee0484ba90cf5f588f4c282048f368 (patch)
tree36e84ed92589a8775bc18e1b056f6b8de14bf2bb /shared/extra-utils/videos
parent68e70a745b2010cd0199864a2addd60d8f99c732 (diff)
downloadPeerTube-bd54ad1953ee0484ba90cf5f588f4c282048f368.tar.gz
PeerTube-bd54ad1953ee0484ba90cf5f588f4c282048f368.tar.zst
PeerTube-bd54ad1953ee0484ba90cf5f588f4c282048f368.zip
Add live notification tests
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 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
44async 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
46export { 60export {
47 getPlaylist, 61 getPlaylist,
48 getSegment, 62 getSegment,
63 checkResolutionsInMasterPlaylist,
49 getSegmentSha256, 64 getSegmentSha256,
50 checkSegmentHash 65 checkSegmentHash
51} 66}