aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video-live.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/server/models/video/video-live.ts b/server/models/video/video-live.ts
index 014491d50..0bc8da022 100644
--- a/server/models/video/video-live.ts
+++ b/server/models/video/video-live.ts
@@ -5,6 +5,7 @@ import { AttributesOnly } from '@shared/core-utils'
5import { LiveVideo, VideoState } from '@shared/models' 5import { LiveVideo, VideoState } from '@shared/models'
6import { VideoModel } from './video' 6import { VideoModel } from './video'
7import { VideoBlacklistModel } from './video-blacklist' 7import { VideoBlacklistModel } from './video-blacklist'
8import { CONFIG } from '@server/initializers/config'
8 9
9@DefaultScope(() => ({ 10@DefaultScope(() => ({
10 include: [ 11 include: [
@@ -97,11 +98,18 @@ export class VideoLiveModel extends Model<Partial<AttributesOnly<VideoLiveModel>
97 } 98 }
98 99
99 toFormattedJSON (): LiveVideo { 100 toFormattedJSON (): LiveVideo {
101 let rtmpUrl: string = null
102 let rtmpsUrl: string = null
103
104 // If we don't have a stream key, it means this is a remote live so we don't specify the rtmp URL
105 if (this.streamKey) {
106 if (CONFIG.LIVE.RTMP.ENABLED) rtmpUrl = WEBSERVER.RTMP_URL
107 if (CONFIG.LIVE.RTMPS.ENABLED) rtmpsUrl = WEBSERVER.RTMPS_URL
108 }
109
100 return { 110 return {
101 // If we don't have a stream key, it means this is a remote live so we don't specify the rtmp URL 111 rtmpUrl,
102 rtmpUrl: this.streamKey 112 rtmpsUrl,
103 ? WEBSERVER.RTMP_URL
104 : null,
105 113
106 streamKey: this.streamKey, 114 streamKey: this.streamKey,
107 permanentLive: this.permanentLive, 115 permanentLive: this.permanentLive,