diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-15 10:02:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch) | |
tree | da82286d423c5e834a1ee2dcd5970076b8263cf1 /shared/extra-utils/videos/live-command.ts | |
parent | 7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff) | |
download | PeerTube-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.ts | 7 |
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' | |||
9 | import { unwrapBody } from '../requests' | 9 | import { unwrapBody } from '../requests' |
10 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | 10 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |
11 | import { sendRTMPStream, testFfmpegStreamError } from './live' | 11 | import { sendRTMPStream, testFfmpegStreamError } from './live' |
12 | import { getVideoWithToken } from './videos' | ||
13 | 12 | ||
14 | export class LiveCommand extends AbstractCommand { | 13 | export 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) |