File tree 4 files changed +30
-5
lines changed
4 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ export default function DisplaySelector(p: IDisplaySelectorProps) {
19
19
const {
20
20
customDestinations,
21
21
platforms,
22
+ updatePlatformDisplayAndSaveSettings,
22
23
updateCustomDestinationDisplay,
23
- updatePlatform,
24
24
isPrime,
25
25
enabledPlatforms,
26
26
updateShouldUseExtraOutput,
@@ -64,7 +64,8 @@ export default function DisplaySelector(p: IDisplaySelectorProps) {
64
64
const display : TDisplayType =
65
65
// Use horizontal display, vertical stream will be created separately
66
66
supportsExtraOutputs && val === 'both' ? 'horizontal' : ( val as TDisplayType ) ;
67
- updatePlatform ( p . platform , { display } ) ;
67
+
68
+ updatePlatformDisplayAndSaveSettings ( p . platform , display ) ;
68
69
69
70
// Add or remove the platform from the Dual Output's extra output platforms list
70
71
updateShouldUseExtraOutput ( p . platform , val ) ;
Original file line number Diff line number Diff line change @@ -444,6 +444,16 @@ export class GoLiveSettingsModule {
444
444
hasExtraOutput ( platform : TPlatform ) {
445
445
return Services . DualOutputService . views . hasExtraOutput ( platform ) ;
446
446
}
447
+
448
+ /* Go live window has no persistence until we go live or toggle a platform on/off
449
+ * As a result we don't get the latest state in any of its views.
450
+ * This makes changing display immediate and is only used in `DisplaySelector`
451
+ * to keep the rest of the code as before, but we might need to revisit that.
452
+ */
453
+ updatePlatformDisplayAndSaveSettings ( platform : TPlatform , display : TDisplayType ) {
454
+ this . state . updatePlatform ( platform , { display } ) ;
455
+ this . save ( this . state . settings ) ;
456
+ }
447
457
}
448
458
449
459
export function useGoLiveSettings ( ) {
Original file line number Diff line number Diff line change @@ -146,8 +146,13 @@ export class StreamSettingsService extends PersistentStatefulService<IStreamSett
146
146
if (
147
147
this . streamingService . views . enabledPlatforms . length > 1 &&
148
148
ytSettings ?. enabled &&
149
- this . dualOutputService . views . hasExtraOutput ( 'youtube' )
149
+ this . dualOutputService . views . hasExtraOutput ( 'youtube' ) &&
150
+ ! (
151
+ this . streamingService . views . activeDisplayPlatforms . vertical . length ||
152
+ this . streamingService . views . activeDisplayDestinations . vertical . length
153
+ )
150
154
) {
155
+ console . log ( 'overrode youtube' ) ;
151
156
return 'StreamSecond' ;
152
157
}
153
158
}
@@ -225,7 +230,7 @@ export class StreamSettingsService extends PersistentStatefulService<IStreamSett
225
230
// transform IGoLiveSettings to ISavedGoLiveSettings
226
231
const patch : Partial < ISavedGoLiveSettings > = settingsPatch ;
227
232
if ( settingsPatch . platforms ) {
228
- const pickedFields : ( keyof IPlatformFlags ) [ ] = [ 'enabled' , 'useCustomFields' ] ;
233
+ const pickedFields : ( keyof IPlatformFlags ) [ ] = [ 'enabled' , 'useCustomFields' , 'display' ] ;
229
234
const platforms : Dictionary < IPlatformFlags > = { } ;
230
235
Object . keys ( settingsPatch . platforms ) . map ( platform => {
231
236
const platformSettings = pick ( settingsPatch . platforms ! [ platform ] , pickedFields ) ;
Original file line number Diff line number Diff line change @@ -1002,11 +1002,20 @@ export class StreamingService
1002
1002
1003
1003
NodeObs . OBS_service_setVideoInfo ( horizontalContext , 'horizontal' ) ;
1004
1004
const ytSettings = this . views . getPlatformSettings ( 'youtube' ) ;
1005
+ /*
1006
+ * HACK: this needs to be addressed and is the result of the old
1007
+ * streaming API *requiring* you to have both horizontal and vertical
1008
+ * outputs to initialize streaming.
1009
+ */
1005
1010
// TODO: this can probably be more generic now
1006
1011
if (
1007
1012
this . views . enabledPlatforms . length > 1 &&
1008
1013
ytSettings ?. enabled &&
1009
- this . dualOutputService . views . hasExtraOutput ( 'youtube' )
1014
+ this . dualOutputService . views . hasExtraOutput ( 'youtube' ) &&
1015
+ ! (
1016
+ this . views . activeDisplayPlatforms . vertical . length ||
1017
+ this . views . activeDisplayDestinations . vertical . length
1018
+ )
1010
1019
) {
1011
1020
NodeObs . OBS_service_setVideoInfo ( horizontalContext , 'vertical' ) ;
1012
1021
} else {
You can’t perform that action at this time.
0 commit comments