ResultList,
VideoCreateResult,
VideoDetails,
+ VideoPrivacy,
VideoState
} from '@shared/models'
import { unwrapBody } from '../requests'
return body.video
}
+ async quickCreate (options: OverrideCommandOptions & {
+ saveReplay: boolean
+ permanentLive: boolean
+ privacy?: VideoPrivacy
+ }) {
+ const { saveReplay, permanentLive, privacy } = options
+
+ const { uuid } = await this.create({
+ ...options,
+
+ fields: {
+ name: 'live',
+ permanentLive,
+ saveReplay,
+ channelId: this.server.store.channel.id,
+ privacy
+ }
+ })
+
+ const video = await this.server.videos.getWithToken({ id: uuid })
+ const live = await this.get({ videoId: uuid })
+
+ return { video, live }
+ }
+
// ---------------------------------------------------------------------------
async sendRTMPStreamInVideo (options: OverrideCommandOptions & {
const segmentName = `${playlistNumber}-00000${segment}.ts`
const baseUrl = objectStorage
- ? ObjectStorageCommand.getPlaylistBaseUrl() + 'hls'
+ ? ObjectStorageCommand.getMockPlaylistBaseUrl() + 'hls'
: server.url + '/static/streaming-playlists/hls'
let error = true
defaultExpectedStatus: HttpStatusCode.OK_200
})
+ const video = await server.videos.get({ id: videoUUID })
+ const hlsPlaylist = video.streamingPlaylists[0]
+
+ const shaBody = await server.streamingPlaylists.getSegmentSha256({ url: hlsPlaylist.segmentsSha256Url })
+
+ if (!shaBody[segmentName]) {
+ throw new Error('Segment SHA does not exist')
+ }
+
error = false
} catch {
error = true
const segmentName = `${playlistNumber}-00000${segment}.ts`
const baseUrl = objectStorage
- ? ObjectStorageCommand.getPlaylistBaseUrl()
+ ? ObjectStorageCommand.getMockPlaylistBaseUrl()
: `${this.server.url}/static/streaming-playlists/hls`
const url = `${baseUrl}/${videoUUID}/${segmentName}`
const { playlistName, videoUUID, objectStorage = false } = options
const baseUrl = objectStorage
- ? ObjectStorageCommand.getPlaylistBaseUrl()
+ ? ObjectStorageCommand.getMockPlaylistBaseUrl()
: `${this.server.url}/static/streaming-playlists/hls`
const url = `${baseUrl}/${videoUUID}/${playlistName}`