aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-live.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-05 11:36:03 +0100
committerChocobozzz <me@florianbigard.com>2021-11-05 11:38:17 +0100
commitdf1db951c512a58110171d046ef367789df02733 (patch)
treea8894b4a4864d9e378923f011b4ca9d206e2ee0b /server/models/video/video-live.ts
parent8dd754c76735417305c4b68e2ada6f623e9d7650 (diff)
downloadPeerTube-df1db951c512a58110171d046ef367789df02733.tar.gz
PeerTube-df1db951c512a58110171d046ef367789df02733.tar.zst
PeerTube-df1db951c512a58110171d046ef367789df02733.zip
Support RTMPS
Diffstat (limited to 'server/models/video/video-live.ts')
-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,