From 52201311e1973a12960466232d4dec861e8258ee Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 26 Nov 2019 16:25:36 +0100 Subject: Add codec information in HLS playlist --- server/tests/api/videos/audio-only.ts | 4 ++-- server/tests/api/videos/video-hls.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'server/tests/api') diff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.ts index f5b6a26e5..f12d730cc 100644 --- a/server/tests/api/videos/audio-only.ts +++ b/server/tests/api/videos/audio-only.ts @@ -22,7 +22,7 @@ import { VideoDetails } from '../../../../shared/models/videos' import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' import { join } from 'path' import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' -import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution, audio, getVideoFileSize } from '@server/helpers/ffmpeg-utils' +import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution, audio, getVideoStreamSize } from '@server/helpers/ffmpeg-utils' const expect = chai.expect @@ -96,7 +96,7 @@ describe('Test audio only video transcoding', function () { expect(audioStream[ 'codec_name' ]).to.be.equal('aac') expect(audioStream[ 'bit_rate' ]).to.be.at.most(384 * 8000) - const size = await getVideoFileSize(path) + const size = await getVideoStreamSize(path) expect(size.height).to.equal(0) expect(size.width).to.equal(0) } diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts index 289209177..bde3b5656 100644 --- a/server/tests/api/videos/video-hls.ts +++ b/server/tests/api/videos/video-hls.ts @@ -66,7 +66,10 @@ async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOn const masterPlaylist = res.text for (const resolution of resolutions) { - expect(masterPlaylist).to.match(new RegExp('#EXT-X-STREAM-INF:BANDWIDTH=\\d+,RESOLUTION=\\d+x' + resolution + ',FRAME-RATE=\\d+')) + const reg = new RegExp('#EXT-X-STREAM-INF:BANDWIDTH=\\d+,RESOLUTION=\\d+x' + resolution + ',FRAME-RATE=\\d+,CODECS="avc1.64001f,mp4a.40.2"') + + expect(masterPlaylist).to.match(reg) + expect(masterPlaylist).to.contain(`${resolution}.m3u8`) expect(masterPlaylist).to.contain(`${resolution}.m3u8`) } } -- cgit v1.2.3