aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/live/live.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/live/live.ts
parent6910f20f114b5bd020258a3a9a3f2117819a60c2 (diff)
downloadPeerTube-57f879a540551c3b958b0991c8e1e3657a4481d8.tar.gz
PeerTube-57f879a540551c3b958b0991c8e1e3657a4481d8.tar.zst
PeerTube-57f879a540551c3b958b0991c8e1e3657a4481d8.zip
Introduce streaming playlists command
Diffstat (limited to 'server/tests/api/live/live.ts')
-rw-r--r--server/tests/api/live/live.ts16
1 files changed, 11 insertions, 5 deletions
diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts
index cb52e4431..0b06df44c 100644
--- a/server/tests/api/live/live.ts
+++ b/server/tests/api/live/live.ts
@@ -15,7 +15,6 @@ import {
15 doubleFollow, 15 doubleFollow,
16 flushAndRunMultipleServers, 16 flushAndRunMultipleServers,
17 getMyVideosWithFilter, 17 getMyVideosWithFilter,
18 getPlaylist,
19 getVideo, 18 getVideo,
20 getVideosList, 19 getVideosList,
21 getVideosWithFilters, 20 getVideosWithFilters,
@@ -397,20 +396,27 @@ describe('Test live', function () {
397 // Only finite files are displayed 396 // Only finite files are displayed
398 expect(hlsPlaylist.files).to.have.lengthOf(0) 397 expect(hlsPlaylist.files).to.have.lengthOf(0)
399 398
400 await checkResolutionsInMasterPlaylist(hlsPlaylist.playlistUrl, resolutions) 399 await checkResolutionsInMasterPlaylist({ server, playlistUrl: hlsPlaylist.playlistUrl, resolutions })
401 400
402 for (let i = 0; i < resolutions.length; i++) { 401 for (let i = 0; i < resolutions.length; i++) {
403 const segmentNum = 3 402 const segmentNum = 3
404 const segmentName = `${i}-00000${segmentNum}.ts` 403 const segmentName = `${i}-00000${segmentNum}.ts`
405 await commands[0].waitUntilSegmentGeneration({ videoUUID: video.uuid, resolution: i, segment: segmentNum }) 404 await commands[0].waitUntilSegmentGeneration({ videoUUID: video.uuid, resolution: i, segment: segmentNum })
406 405
407 const res = await getPlaylist(`${servers[0].url}/static/streaming-playlists/hls/${video.uuid}/${i}.m3u8`) 406 const subPlaylist = await servers[0].streamingPlaylistsCommand.get({
408 const subPlaylist = res.text 407 url: `${servers[0].url}/static/streaming-playlists/hls/${video.uuid}/${i}.m3u8`
408 })
409 409
410 expect(subPlaylist).to.contain(segmentName) 410 expect(subPlaylist).to.contain(segmentName)
411 411
412 const baseUrlAndPath = servers[0].url + '/static/streaming-playlists/hls' 412 const baseUrlAndPath = servers[0].url + '/static/streaming-playlists/hls'
413 await checkLiveSegmentHash(baseUrlAndPath, video.uuid, segmentName, hlsPlaylist) 413 await checkLiveSegmentHash({
414 server,
415 baseUrlSegment: baseUrlAndPath,
416 videoUUID: video.uuid,
417 segmentName,
418 hlsPlaylist
419 })
414 } 420 }
415 } 421 }
416 } 422 }