From df1db951c512a58110171d046ef367789df02733 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 5 Nov 2021 11:36:03 +0100 Subject: Support RTMPS --- server/models/video/video-live.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'server/models') 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' import { LiveVideo, VideoState } from '@shared/models' import { VideoModel } from './video' import { VideoBlacklistModel } from './video-blacklist' +import { CONFIG } from '@server/initializers/config' @DefaultScope(() => ({ include: [ @@ -97,11 +98,18 @@ export class VideoLiveModel extends Model } toFormattedJSON (): LiveVideo { + let rtmpUrl: string = null + let rtmpsUrl: string = null + + // If we don't have a stream key, it means this is a remote live so we don't specify the rtmp URL + if (this.streamKey) { + if (CONFIG.LIVE.RTMP.ENABLED) rtmpUrl = WEBSERVER.RTMP_URL + if (CONFIG.LIVE.RTMPS.ENABLED) rtmpsUrl = WEBSERVER.RTMPS_URL + } + return { - // If we don't have a stream key, it means this is a remote live so we don't specify the rtmp URL - rtmpUrl: this.streamKey - ? WEBSERVER.RTMP_URL - : null, + rtmpUrl, + rtmpsUrl, streamKey: this.streamKey, permanentLive: this.permanentLive, -- cgit v1.2.3