diff options
Diffstat (limited to 'shared/server-commands/videos/live-command.ts')
-rw-r--r-- | shared/server-commands/videos/live-command.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/shared/server-commands/videos/live-command.ts b/shared/server-commands/videos/live-command.ts index b163f7189..de193fa49 100644 --- a/shared/server-commands/videos/live-command.ts +++ b/shared/server-commands/videos/live-command.ts | |||
@@ -12,6 +12,7 @@ import { | |||
12 | ResultList, | 12 | ResultList, |
13 | VideoCreateResult, | 13 | VideoCreateResult, |
14 | VideoDetails, | 14 | VideoDetails, |
15 | VideoPrivacy, | ||
15 | VideoState | 16 | VideoState |
16 | } from '@shared/models' | 17 | } from '@shared/models' |
17 | import { unwrapBody } from '../requests' | 18 | import { unwrapBody } from '../requests' |
@@ -115,6 +116,31 @@ export class LiveCommand extends AbstractCommand { | |||
115 | return body.video | 116 | return body.video |
116 | } | 117 | } |
117 | 118 | ||
119 | async quickCreate (options: OverrideCommandOptions & { | ||
120 | saveReplay: boolean | ||
121 | permanentLive: boolean | ||
122 | privacy?: VideoPrivacy | ||
123 | }) { | ||
124 | const { saveReplay, permanentLive, privacy } = options | ||
125 | |||
126 | const { uuid } = await this.create({ | ||
127 | ...options, | ||
128 | |||
129 | fields: { | ||
130 | name: 'live', | ||
131 | permanentLive, | ||
132 | saveReplay, | ||
133 | channelId: this.server.store.channel.id, | ||
134 | privacy | ||
135 | } | ||
136 | }) | ||
137 | |||
138 | const video = await this.server.videos.getWithToken({ id: uuid }) | ||
139 | const live = await this.get({ videoId: uuid }) | ||
140 | |||
141 | return { video, live } | ||
142 | } | ||
143 | |||
118 | // --------------------------------------------------------------------------- | 144 | // --------------------------------------------------------------------------- |
119 | 145 | ||
120 | async sendRTMPStreamInVideo (options: OverrideCommandOptions & { | 146 | async sendRTMPStreamInVideo (options: OverrideCommandOptions & { |