-async function saveLive (video: MVideo, live: MVideoLive) {
- const hlsDirectory = getHLSDirectory(video, false)
- const files = await readdir(hlsDirectory)
-
- const playlistFiles = files.filter(f => f.endsWith('.m3u8') && f !== 'master.m3u8')
- const resolutions: number[] = []
- let duration: number
-
- for (const playlistFile of playlistFiles) {
- const playlistPath = join(hlsDirectory, playlistFile)
- const { videoFileResolution } = await getVideoFileResolution(playlistPath)
-
- const mp4TmpPath = buildMP4TmpPath(hlsDirectory, videoFileResolution)
-
- // Playlist name is for example 3.m3u8
- // Segments names are 3-0.ts 3-1.ts etc
- const shouldStartWith = playlistFile.replace(/\.m3u8$/, '') + '-'
+async function saveLive (video: MVideo, live: MVideoLive, streamingPlaylist: MStreamingPlaylist) {
+ const replayDirectory = VideoPathManager.Instance.getFSHLSOutputPath(video, VIDEO_LIVE.REPLAY_DIRECTORY)