aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-07 15:08:19 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-02-11 09:13:02 +0100
commit4c280004ce62bf11ddb091854c28f1e1d54a54d6 (patch)
tree1899fff4ef18f8663a865997d5d06119b2149319 /server/tests/api/videos
parent6ec0b75beb9c8bcd84e178912319913b91830da2 (diff)
downloadPeerTube-4c280004ce62bf11ddb091854c28f1e1d54a54d6.tar.gz
PeerTube-4c280004ce62bf11ddb091854c28f1e1d54a54d6.tar.zst
PeerTube-4c280004ce62bf11ddb091854c28f1e1d54a54d6.zip
Use a single file instead of segments for HLS
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/video-hls.ts16
1 files changed, 5 insertions, 11 deletions
diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts
index 71d863b12..a1214bad1 100644
--- a/server/tests/api/videos/video-hls.ts
+++ b/server/tests/api/videos/video-hls.ts
@@ -4,13 +4,12 @@ import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { 5import {
6 checkDirectoryIsEmpty, 6 checkDirectoryIsEmpty,
7 checkSegmentHash,
7 checkTmpIsEmpty, 8 checkTmpIsEmpty,
8 doubleFollow, 9 doubleFollow,
9 flushAndRunMultipleServers, 10 flushAndRunMultipleServers,
10 flushTests, 11 flushTests,
11 getPlaylist, 12 getPlaylist,
12 getSegment,
13 getSegmentSha256,
14 getVideo, 13 getVideo,
15 killallServers, 14 killallServers,
16 removeVideo, 15 removeVideo,
@@ -22,7 +21,6 @@ import {
22} from '../../../../shared/utils' 21} from '../../../../shared/utils'
23import { VideoDetails } from '../../../../shared/models/videos' 22import { VideoDetails } from '../../../../shared/models/videos'
24import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' 23import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type'
25import { sha256 } from '../../../helpers/core-utils'
26import { join } from 'path' 24import { join } from 'path'
27 25
28const expect = chai.expect 26const expect = chai.expect
@@ -56,19 +54,15 @@ async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string) {
56 const res2 = await getPlaylist(`http://localhost:9001/static/playlists/hls/${videoUUID}/${resolution}.m3u8`) 54 const res2 = await getPlaylist(`http://localhost:9001/static/playlists/hls/${videoUUID}/${resolution}.m3u8`)
57 55
58 const subPlaylist = res2.text 56 const subPlaylist = res2.text
59 expect(subPlaylist).to.contain(resolution + '_000.ts') 57 expect(subPlaylist).to.contain(`${videoUUID}-${resolution}-fragmented.mp4`)
60 } 58 }
61 } 59 }
62 60
63 { 61 {
64 for (const resolution of resolutions) { 62 const baseUrl = 'http://localhost:9001/static/playlists/hls'
65
66 const res2 = await getSegment(`http://localhost:9001/static/playlists/hls/${videoUUID}/${resolution}_000.ts`)
67 63
68 const resSha = await getSegmentSha256(hlsPlaylist.segmentsSha256Url) 64 for (const resolution of resolutions) {
69 65 await checkSegmentHash(baseUrl, baseUrl, videoUUID, resolution, hlsPlaylist)
70 const sha256Server = resSha.body[ resolution + '_000.ts' ]
71 expect(sha256(res2.body)).to.equal(sha256Server)
72 } 66 }
73 } 67 }
74 } 68 }