aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-hls.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-09 10:21:10 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit57f879a540551c3b958b0991c8e1e3657a4481d8 (patch)
treecd9283dec9ef0b7fee116c93c36650de188ad892 /server/tests/api/videos/video-hls.ts
parent6910f20f114b5bd020258a3a9a3f2117819a60c2 (diff)
downloadPeerTube-57f879a540551c3b958b0991c8e1e3657a4481d8.tar.gz
PeerTube-57f879a540551c3b958b0991c8e1e3657a4481d8.tar.zst
PeerTube-57f879a540551c3b958b0991c8e1e3657a4481d8.zip
Introduce streaming playlists command
Diffstat (limited to 'server/tests/api/videos/video-hls.ts')
-rw-r--r--server/tests/api/videos/video-hls.ts20
1 files changed, 13 insertions, 7 deletions
diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts
index 3821cfed0..3dd8c9066 100644
--- a/server/tests/api/videos/video-hls.ts
+++ b/server/tests/api/videos/video-hls.ts
@@ -12,7 +12,6 @@ import {
12 cleanupTests, 12 cleanupTests,
13 doubleFollow, 13 doubleFollow,
14 flushAndRunMultipleServers, 14 flushAndRunMultipleServers,
15 getPlaylist,
16 getVideo, 15 getVideo,
17 makeRawRequest, 16 makeRawRequest,
18 removeVideo, 17 removeVideo,
@@ -67,10 +66,9 @@ async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOn
67 } 66 }
68 67
69 { 68 {
70 await checkResolutionsInMasterPlaylist(hlsPlaylist.playlistUrl, resolutions) 69 await checkResolutionsInMasterPlaylist({ server, playlistUrl: hlsPlaylist.playlistUrl, resolutions })
71 70
72 const res = await getPlaylist(hlsPlaylist.playlistUrl) 71 const masterPlaylist = await server.streamingPlaylistsCommand.get({ url: hlsPlaylist.playlistUrl })
73 const masterPlaylist = res.text
74 72
75 for (const resolution of resolutions) { 73 for (const resolution of resolutions) {
76 expect(masterPlaylist).to.contain(`${resolution}.m3u8`) 74 expect(masterPlaylist).to.contain(`${resolution}.m3u8`)
@@ -80,9 +78,10 @@ async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOn
80 78
81 { 79 {
82 for (const resolution of resolutions) { 80 for (const resolution of resolutions) {
83 const res = await getPlaylist(`${baseUrl}/static/streaming-playlists/hls/${videoUUID}/${resolution}.m3u8`) 81 const subPlaylist = await server.streamingPlaylistsCommand.get({
82 url: `${baseUrl}/static/streaming-playlists/hls/${videoUUID}/${resolution}.m3u8`
83 })
84 84
85 const subPlaylist = res.text
86 expect(subPlaylist).to.contain(`${videoUUID}-${resolution}-fragmented.mp4`) 85 expect(subPlaylist).to.contain(`${videoUUID}-${resolution}-fragmented.mp4`)
87 } 86 }
88 } 87 }
@@ -91,7 +90,14 @@ async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOn
91 const baseUrlAndPath = baseUrl + '/static/streaming-playlists/hls' 90 const baseUrlAndPath = baseUrl + '/static/streaming-playlists/hls'
92 91
93 for (const resolution of resolutions) { 92 for (const resolution of resolutions) {
94 await checkSegmentHash(baseUrlAndPath, baseUrlAndPath, videoUUID, resolution, hlsPlaylist) 93 await checkSegmentHash({
94 server,
95 baseUrlPlaylist: baseUrlAndPath,
96 baseUrlSegment: baseUrlAndPath,
97 videoUUID,
98 resolution,
99 hlsPlaylist
100 })
95 } 101 }
96 } 102 }
97 } 103 }