diff options
author | Chocobozzz <me@florianbigard.com> | 2021-11-05 11:36:03 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-11-05 11:38:17 +0100 |
commit | df1db951c512a58110171d046ef367789df02733 (patch) | |
tree | a8894b4a4864d9e378923f011b4ca9d206e2ee0b /server/models/video/video-live.ts | |
parent | 8dd754c76735417305c4b68e2ada6f623e9d7650 (diff) | |
download | PeerTube-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.ts | 16 |
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' | |||
5 | import { LiveVideo, VideoState } from '@shared/models' | 5 | import { LiveVideo, VideoState } from '@shared/models' |
6 | import { VideoModel } from './video' | 6 | import { VideoModel } from './video' |
7 | import { VideoBlacklistModel } from './video-blacklist' | 7 | import { VideoBlacklistModel } from './video-blacklist' |
8 | import { 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, |