aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/live/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-27 14:32:44 +0200
committerChocobozzz <me@florianbigard.com>2021-08-27 15:12:22 +0200
commit41fb13c330de629df2d23379209e79c7af0f2e9a (patch)
tree73bc5a90566406b3910f142beae2a879c1e4265d /server/lib/live/shared
parent40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff)
downloadPeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip
esModuleInterop to true
Diffstat (limited to 'server/lib/live/shared')
-rw-r--r--server/lib/live/shared/muxing-session.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/lib/live/shared/muxing-session.ts b/server/lib/live/shared/muxing-session.ts
index 0c9fb0cb6..a6907142d 100644
--- a/server/lib/live/shared/muxing-session.ts
+++ b/server/lib/live/shared/muxing-session.ts
@@ -1,6 +1,6 @@
1 1
2import * as Bluebird from 'bluebird' 2import { mapSeries } from 'bluebird'
3import * as chokidar from 'chokidar' 3import { FSWatcher, watch } from 'chokidar'
4import { FfmpegCommand } from 'fluent-ffmpeg' 4import { FfmpegCommand } from 'fluent-ffmpeg'
5import { appendFile, ensureDir, readFile, stat } from 'fs-extra' 5import { appendFile, ensureDir, readFile, stat } from 'fs-extra'
6import { basename, join } from 'path' 6import { basename, join } from 'path'
@@ -67,8 +67,8 @@ class MuxingSession extends EventEmitter {
67 67
68 private segmentsToProcessPerPlaylist: { [playlistId: string]: string[] } = {} 68 private segmentsToProcessPerPlaylist: { [playlistId: string]: string[] } = {}
69 69
70 private tsWatcher: chokidar.FSWatcher 70 private tsWatcher: FSWatcher
71 private masterWatcher: chokidar.FSWatcher 71 private masterWatcher: FSWatcher
72 72
73 private readonly isAbleToUploadVideoWithCache = memoizee((userId: number) => { 73 private readonly isAbleToUploadVideoWithCache = memoizee((userId: number) => {
74 return isAbleToUploadVideo(userId, 1000) 74 return isAbleToUploadVideo(userId, 1000)
@@ -197,7 +197,7 @@ class MuxingSession extends EventEmitter {
197 } 197 }
198 198
199 private watchMasterFile (outPath: string) { 199 private watchMasterFile (outPath: string) {
200 this.masterWatcher = chokidar.watch(outPath + '/' + this.streamingPlaylist.playlistFilename) 200 this.masterWatcher = watch(outPath + '/' + this.streamingPlaylist.playlistFilename)
201 201
202 this.masterWatcher.on('add', () => { 202 this.masterWatcher.on('add', () => {
203 this.emit('master-playlist-created', { videoId: this.videoId }) 203 this.emit('master-playlist-created', { videoId: this.videoId })
@@ -210,7 +210,7 @@ class MuxingSession extends EventEmitter {
210 private watchTSFiles (outPath: string) { 210 private watchTSFiles (outPath: string) {
211 const startStreamDateTime = new Date().getTime() 211 const startStreamDateTime = new Date().getTime()
212 212
213 this.tsWatcher = chokidar.watch(outPath + '/*.ts') 213 this.tsWatcher = watch(outPath + '/*.ts')
214 214
215 const playlistIdMatcher = /^([\d+])-/ 215 const playlistIdMatcher = /^([\d+])-/
216 216
@@ -306,7 +306,7 @@ class MuxingSession extends EventEmitter {
306 } 306 }
307 307
308 private processSegments (hlsVideoPath: string, segmentPaths: string[]) { 308 private processSegments (hlsVideoPath: string, segmentPaths: string[]) {
309 Bluebird.mapSeries(segmentPaths, async previousSegment => { 309 mapSeries(segmentPaths, async previousSegment => {
310 // Add sha hash of previous segments, because ffmpeg should have finished generating them 310 // Add sha hash of previous segments, because ffmpeg should have finished generating them
311 await LiveSegmentShaStore.Instance.addSegmentSha(this.videoUUID, previousSegment) 311 await LiveSegmentShaStore.Instance.addSegmentSha(this.videoUUID, previousSegment)
312 312