diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-27 14:32:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-27 15:12:22 +0200 |
commit | 41fb13c330de629df2d23379209e79c7af0f2e9a (patch) | |
tree | 73bc5a90566406b3910f142beae2a879c1e4265d /shared/extra-utils/videos | |
parent | 40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff) | |
download | PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip |
esModuleInterop to true
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r-- | shared/extra-utils/videos/captions.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/videos/live.ts | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/shared/extra-utils/videos/captions.ts b/shared/extra-utils/videos/captions.ts index ff8a43366..fc44cd250 100644 --- a/shared/extra-utils/videos/captions.ts +++ b/shared/extra-utils/videos/captions.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { expect } from 'chai' | 1 | import { expect } from 'chai' |
2 | import * as request from 'supertest' | 2 | import request from 'supertest' |
3 | import { HttpStatusCode } from '@shared/models' | 3 | import { HttpStatusCode } from '@shared/models' |
4 | 4 | ||
5 | async function testCaptionFile (url: string, captionPath: string, containsString: string) { | 5 | async function testCaptionFile (url: string, captionPath: string, containsString: string) { |
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts index 29f99ed6d..d3665bc90 100644 --- a/shared/extra-utils/videos/live.ts +++ b/shared/extra-utils/videos/live.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
4 | import * as ffmpeg from 'fluent-ffmpeg' | 4 | import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg' |
5 | import { pathExists, readdir } from 'fs-extra' | 5 | import { pathExists, readdir } from 'fs-extra' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { buildAbsoluteFixturePath, wait } from '../miscs' | 7 | import { buildAbsoluteFixturePath, wait } from '../miscs' |
@@ -50,7 +50,7 @@ function sendRTMPStream (options: { | |||
50 | return command | 50 | return command |
51 | } | 51 | } |
52 | 52 | ||
53 | function waitFfmpegUntilError (command: ffmpeg.FfmpegCommand, successAfterMS = 10000) { | 53 | function waitFfmpegUntilError (command: FfmpegCommand, successAfterMS = 10000) { |
54 | return new Promise<void>((res, rej) => { | 54 | return new Promise<void>((res, rej) => { |
55 | command.on('error', err => { | 55 | command.on('error', err => { |
56 | return rej(err) | 56 | return rej(err) |
@@ -62,7 +62,7 @@ function waitFfmpegUntilError (command: ffmpeg.FfmpegCommand, successAfterMS = 1 | |||
62 | }) | 62 | }) |
63 | } | 63 | } |
64 | 64 | ||
65 | async function testFfmpegStreamError (command: ffmpeg.FfmpegCommand, shouldHaveError: boolean) { | 65 | async function testFfmpegStreamError (command: FfmpegCommand, shouldHaveError: boolean) { |
66 | let error: Error | 66 | let error: Error |
67 | 67 | ||
68 | try { | 68 | try { |
@@ -77,7 +77,7 @@ async function testFfmpegStreamError (command: ffmpeg.FfmpegCommand, shouldHaveE | |||
77 | if (!shouldHaveError && error) throw error | 77 | if (!shouldHaveError && error) throw error |
78 | } | 78 | } |
79 | 79 | ||
80 | async function stopFfmpeg (command: ffmpeg.FfmpegCommand) { | 80 | async function stopFfmpeg (command: FfmpegCommand) { |
81 | command.kill('SIGINT') | 81 | command.kill('SIGINT') |
82 | 82 | ||
83 | await wait(500) | 83 | await wait(500) |