From 6eb38895fc06b83666e9b7d083509e37ea56728e Mon Sep 17 00:00:00 2001 From: mhoyer-streamlabs Date: Fri, 19 Dec 2025 12:10:43 -0600 Subject: [PATCH 1/6] Revert to user-configured settings after stream ends --- app/services/platforms/youtube.ts | 33 ++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/app/services/platforms/youtube.ts b/app/services/platforms/youtube.ts index 7d93fde63c54..737c98c73026 100644 --- a/app/services/platforms/youtube.ts +++ b/app/services/platforms/youtube.ts @@ -37,7 +37,14 @@ interface IYoutubeServiceState extends IPlatformState { broadcastStatus: TBroadcastLifecycleStatus | ''; settings: IYoutubeStartStreamOptions; categories: IYoutubeCategory[]; -} + backupStreamSettings?: IBackUpStreamSettings;} + +interface IBackUpStreamSettings { + key: string; + server: string; + streamType: 'rtmp_common' | 'rtmp_custom' | 'whip_custom'; + context: TDisplayType; + } export interface IYoutubeStartStreamOptions extends IExtraBroadcastSettings { title: string; @@ -537,6 +544,18 @@ export class YoutubeService // setup key and platform type in the OBS settings const streamKey = stream.cdn.ingestionInfo.streamName; + console.log('MLH beforeGoLive save current stream settings'); + + //MLH save user's current rtmp_common settings to restore after Go Live since they are overwritten here + const currentSettings = this.streamSettingsService.settings; + if (!this.state.backupStreamSettings) { + this.state.backupStreamSettings = {} as IBackUpStreamSettings; + } + this.state.backupStreamSettings.key = currentSettings.key; + this.state.backupStreamSettings.server = currentSettings.server; + this.state.backupStreamSettings.streamType = currentSettings.streamType; + this.state.backupStreamSettings.context = context ? context : 'horizontal'; + if (!this.streamingService.views.isMultiplatformMode) { this.streamSettingsService.setSettings( { @@ -598,6 +617,18 @@ export class YoutubeService this.SET_VERTICAL_BROADCAST({} as IYoutubeLiveBroadcast); this.SET_VERTICAL_STREAM_KEY(''); this.streamSettingsService.setGoLiveSettings({ customDestinations: destinations }); + + //MLH restore user's previous settings in case they were overwritten on Go Live + console.log('MLH youtube.ts afterStopStream restore previous stream settings: ', this.state.backupStreamSettings); + this.streamSettingsService.setSettings( + { + platform: 'youtube', + key: this.state.backupStreamSettings.key, + streamType: this.state.backupStreamSettings.streamType, + server: this.state.backupStreamSettings.server, + }, + this.state.backupStreamSettings.context, + ); } /** From 079de45b19367ec596a6dbf75a84b1a3eaab822e Mon Sep 17 00:00:00 2001 From: mhoyer-streamlabs Date: Wed, 7 Jan 2026 13:48:09 -0600 Subject: [PATCH 2/6] Save settings on Go Live so they can be restored User-configured settings are lost when values are hardcoded, save them to restore after streaming so avoid errors on app restart --- app/services/platforms/youtube.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/services/platforms/youtube.ts b/app/services/platforms/youtube.ts index 737c98c73026..c40ab003a5c3 100644 --- a/app/services/platforms/youtube.ts +++ b/app/services/platforms/youtube.ts @@ -40,6 +40,7 @@ interface IYoutubeServiceState extends IPlatformState { backupStreamSettings?: IBackUpStreamSettings;} interface IBackUpStreamSettings { + service: string; key: string; server: string; streamType: 'rtmp_common' | 'rtmp_custom' | 'whip_custom'; @@ -551,12 +552,14 @@ export class YoutubeService if (!this.state.backupStreamSettings) { this.state.backupStreamSettings = {} as IBackUpStreamSettings; } + this.state.backupStreamSettings.service = currentSettings.service; this.state.backupStreamSettings.key = currentSettings.key; this.state.backupStreamSettings.server = currentSettings.server; this.state.backupStreamSettings.streamType = currentSettings.streamType; this.state.backupStreamSettings.context = context ? context : 'horizontal'; if (!this.streamingService.views.isMultiplatformMode) { + console.log('MLH in beforeGoLive set with current and adding service name'); this.streamSettingsService.setSettings( { platform: 'youtube', @@ -619,10 +622,10 @@ export class YoutubeService this.streamSettingsService.setGoLiveSettings({ customDestinations: destinations }); //MLH restore user's previous settings in case they were overwritten on Go Live - console.log('MLH youtube.ts afterStopStream restore previous stream settings: ', this.state.backupStreamSettings); this.streamSettingsService.setSettings( { platform: 'youtube', + service: this.state.backupStreamSettings.service, key: this.state.backupStreamSettings.key, streamType: this.state.backupStreamSettings.streamType, server: this.state.backupStreamSettings.server, From 948b6f35cb1383a87d4471d1c84d97744572d937 Mon Sep 17 00:00:00 2001 From: mhoyer-streamlabs Date: Fri, 9 Jan 2026 05:45:55 -0600 Subject: [PATCH 3/6] Only include relevant stream types --- app/services/platforms/youtube.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/platforms/youtube.ts b/app/services/platforms/youtube.ts index c40ab003a5c3..67188532a99b 100644 --- a/app/services/platforms/youtube.ts +++ b/app/services/platforms/youtube.ts @@ -43,7 +43,7 @@ interface IBackUpStreamSettings { service: string; key: string; server: string; - streamType: 'rtmp_common' | 'rtmp_custom' | 'whip_custom'; + streamType: 'rtmp_common' | 'rtmp_custom'; context: TDisplayType; } From e134017382a445ff9d66310ea0d944bfd97e4bfb Mon Sep 17 00:00:00 2001 From: mhoyer-streamlabs Date: Fri, 9 Jan 2026 05:54:26 -0600 Subject: [PATCH 4/6] Revert "Only include relevant stream types" This reverts commit 948b6f35cb1383a87d4471d1c84d97744572d937. --- app/services/platforms/youtube.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/platforms/youtube.ts b/app/services/platforms/youtube.ts index 67188532a99b..c40ab003a5c3 100644 --- a/app/services/platforms/youtube.ts +++ b/app/services/platforms/youtube.ts @@ -43,7 +43,7 @@ interface IBackUpStreamSettings { service: string; key: string; server: string; - streamType: 'rtmp_common' | 'rtmp_custom'; + streamType: 'rtmp_common' | 'rtmp_custom' | 'whip_custom'; context: TDisplayType; } From 5b3832ca39ffc25d6d2ca7845d31f8a0647cf8a9 Mon Sep 17 00:00:00 2001 From: mhoyer-streamlabs Date: Tue, 27 Jan 2026 11:52:29 -0600 Subject: [PATCH 5/6] Remove testing logging --- app/services/platforms/youtube.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/services/platforms/youtube.ts b/app/services/platforms/youtube.ts index c40ab003a5c3..a62cb0d1d02c 100644 --- a/app/services/platforms/youtube.ts +++ b/app/services/platforms/youtube.ts @@ -545,9 +545,7 @@ export class YoutubeService // setup key and platform type in the OBS settings const streamKey = stream.cdn.ingestionInfo.streamName; - console.log('MLH beforeGoLive save current stream settings'); - - //MLH save user's current rtmp_common settings to restore after Go Live since they are overwritten here + //save user's current rtmp_common settings to restore after Go Live since they are overwritten here const currentSettings = this.streamSettingsService.settings; if (!this.state.backupStreamSettings) { this.state.backupStreamSettings = {} as IBackUpStreamSettings; @@ -559,7 +557,6 @@ export class YoutubeService this.state.backupStreamSettings.context = context ? context : 'horizontal'; if (!this.streamingService.views.isMultiplatformMode) { - console.log('MLH in beforeGoLive set with current and adding service name'); this.streamSettingsService.setSettings( { platform: 'youtube', @@ -621,7 +618,7 @@ export class YoutubeService this.SET_VERTICAL_STREAM_KEY(''); this.streamSettingsService.setGoLiveSettings({ customDestinations: destinations }); - //MLH restore user's previous settings in case they were overwritten on Go Live + //restore user's previous settings in case they were overwritten on Go Live this.streamSettingsService.setSettings( { platform: 'youtube', From 7682292ec8d314f5caac13a3ea21e813882e1495 Mon Sep 17 00:00:00 2001 From: mhoyer-streamlabs Date: Fri, 6 Feb 2026 15:10:44 -0600 Subject: [PATCH 6/6] Update youtube.ts --- app/services/platforms/youtube.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/services/platforms/youtube.ts b/app/services/platforms/youtube.ts index a62cb0d1d02c..e015483b03ec 100644 --- a/app/services/platforms/youtube.ts +++ b/app/services/platforms/youtube.ts @@ -37,15 +37,16 @@ interface IYoutubeServiceState extends IPlatformState { broadcastStatus: TBroadcastLifecycleStatus | ''; settings: IYoutubeStartStreamOptions; categories: IYoutubeCategory[]; - backupStreamSettings?: IBackUpStreamSettings;} - -interface IBackUpStreamSettings { - service: string; - key: string; - server: string; - streamType: 'rtmp_common' | 'rtmp_custom' | 'whip_custom'; - context: TDisplayType; - } + backupStreamSettings?: IBackUpStreamSettings; +} + +interface IBackUpStreamSettings { + service: string; + key: string; + server: string; + streamType: 'rtmp_common' | 'rtmp_custom' | 'whip_custom'; + context: TDisplayType; +} export interface IYoutubeStartStreamOptions extends IExtraBroadcastSettings { title: string; @@ -554,7 +555,7 @@ export class YoutubeService this.state.backupStreamSettings.key = currentSettings.key; this.state.backupStreamSettings.server = currentSettings.server; this.state.backupStreamSettings.streamType = currentSettings.streamType; - this.state.backupStreamSettings.context = context ? context : 'horizontal'; + this.state.backupStreamSettings.context = !context ? 'horizontal' : context; if (!this.streamingService.views.isMultiplatformMode) { this.streamSettingsService.setSettings(