mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Also retry when fetching master m3u8 playlist
This commit is contained in:
parent
080f14025e
commit
8bd6aa0424
@ -3,7 +3,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { pathExists, readdir } from 'fs-extra'
|
import { pathExists, readdir } from 'fs-extra'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { wait } from '@shared/core-utils'
|
|
||||||
import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models'
|
import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models'
|
||||||
import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands'
|
import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands'
|
||||||
import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists'
|
import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists'
|
||||||
@ -42,7 +41,13 @@ async function testVideoResolutions (options: {
|
|||||||
expect(hlsPlaylist).to.exist
|
expect(hlsPlaylist).to.exist
|
||||||
expect(hlsPlaylist.files).to.have.lengthOf(0) // Only fragmented mp4 files are displayed
|
expect(hlsPlaylist.files).to.have.lengthOf(0) // Only fragmented mp4 files are displayed
|
||||||
|
|
||||||
await checkResolutionsInMasterPlaylist({ server, playlistUrl: hlsPlaylist.playlistUrl, resolutions, transcoded })
|
await checkResolutionsInMasterPlaylist({
|
||||||
|
server,
|
||||||
|
playlistUrl: hlsPlaylist.playlistUrl,
|
||||||
|
resolutions,
|
||||||
|
transcoded,
|
||||||
|
withRetry: objectStorage
|
||||||
|
})
|
||||||
|
|
||||||
if (objectStorage) {
|
if (objectStorage) {
|
||||||
expect(hlsPlaylist.playlistUrl).to.contain(ObjectStorageCommand.getPlaylistBaseUrl())
|
expect(hlsPlaylist.playlistUrl).to.contain(ObjectStorageCommand.getPlaylistBaseUrl())
|
||||||
@ -59,7 +64,6 @@ async function testVideoResolutions (options: {
|
|||||||
|
|
||||||
if (objectStorage) {
|
if (objectStorage) {
|
||||||
await originServer.live.waitUntilSegmentUpload({ playlistNumber: i, segment: segmentNum })
|
await originServer.live.waitUntilSegmentUpload({ playlistNumber: i, segment: segmentNum })
|
||||||
await wait(1000)
|
|
||||||
|
|
||||||
expect(hlsPlaylist.segmentsSha256Url).to.contain(ObjectStorageCommand.getPlaylistBaseUrl())
|
expect(hlsPlaylist.segmentsSha256Url).to.contain(ObjectStorageCommand.getPlaylistBaseUrl())
|
||||||
}
|
}
|
||||||
|
@ -57,10 +57,11 @@ async function checkResolutionsInMasterPlaylist (options: {
|
|||||||
playlistUrl: string
|
playlistUrl: string
|
||||||
resolutions: number[]
|
resolutions: number[]
|
||||||
transcoded?: boolean // default true
|
transcoded?: boolean // default true
|
||||||
|
withRetry?: boolean // default false
|
||||||
}) {
|
}) {
|
||||||
const { server, playlistUrl, resolutions, transcoded = true } = options
|
const { server, playlistUrl, resolutions, withRetry = false, transcoded = true } = options
|
||||||
|
|
||||||
const masterPlaylist = await server.streamingPlaylists.get({ url: playlistUrl })
|
const masterPlaylist = await server.streamingPlaylists.get({ url: playlistUrl, withRetry })
|
||||||
|
|
||||||
for (const resolution of resolutions) {
|
for (const resolution of resolutions) {
|
||||||
const reg = transcoded
|
const reg = transcoded
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg'
|
import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg'
|
||||||
import { buildAbsoluteFixturePath, wait } from '@shared/core-utils'
|
import { buildAbsoluteFixturePath, wait } from '@shared/core-utils'
|
||||||
import { PeerTubeServer } from '../server/server'
|
|
||||||
import { VideoDetails, VideoInclude } from '@shared/models'
|
import { VideoDetails, VideoInclude } from '@shared/models'
|
||||||
|
import { PeerTubeServer } from '../server/server'
|
||||||
|
|
||||||
function sendRTMPStream (options: {
|
function sendRTMPStream (options: {
|
||||||
rtmpBaseUrl: string
|
rtmpBaseUrl: string
|
||||||
|
Loading…
Reference in New Issue
Block a user