aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/live-command.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-15 10:02:54 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitd23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch)
treeda82286d423c5e834a1ee2dcd5970076b8263cf1 /shared/extra-utils/videos/live-command.ts
parent7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff)
downloadPeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.gz
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.zst
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.zip
Introduce videos command
Diffstat (limited to 'shared/extra-utils/videos/live-command.ts')
-rw-r--r--shared/extra-utils/videos/live-command.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/shared/extra-utils/videos/live-command.ts b/shared/extra-utils/videos/live-command.ts
index a494e60fa..5adf601cc 100644
--- a/shared/extra-utils/videos/live-command.ts
+++ b/shared/extra-utils/videos/live-command.ts
@@ -9,7 +9,6 @@ import { wait } from '../miscs'
9import { unwrapBody } from '../requests' 9import { unwrapBody } from '../requests'
10import { AbstractCommand, OverrideCommandOptions } from '../shared' 10import { AbstractCommand, OverrideCommandOptions } from '../shared'
11import { sendRTMPStream, testFfmpegStreamError } from './live' 11import { sendRTMPStream, testFfmpegStreamError } from './live'
12import { getVideoWithToken } from './videos'
13 12
14export class LiveCommand extends AbstractCommand { 13export class LiveCommand extends AbstractCommand {
15 14
@@ -124,8 +123,7 @@ export class LiveCommand extends AbstractCommand {
124 let video: VideoDetails 123 let video: VideoDetails
125 124
126 do { 125 do {
127 const res = await getVideoWithToken(this.server.url, options.token ?? this.server.accessToken, options.videoId) 126 video = await this.server.videosCommand.getWithToken({ token: options.token, id: options.videoId })
128 video = res.body
129 127
130 await wait(500) 128 await wait(500)
131 } while (video.isLive === true && video.state.id !== VideoState.PUBLISHED) 129 } while (video.isLive === true && video.state.id !== VideoState.PUBLISHED)
@@ -149,8 +147,7 @@ export class LiveCommand extends AbstractCommand {
149 let video: VideoDetails 147 let video: VideoDetails
150 148
151 do { 149 do {
152 const res = await getVideoWithToken(this.server.url, options.token ?? this.server.accessToken, options.videoId) 150 video = await this.server.videosCommand.getWithToken({ token: options.token, id: options.videoId })
153 video = res.body
154 151
155 await wait(500) 152 await wait(500)
156 } while (video.state.id !== options.state) 153 } while (video.state.id !== options.state)