feat: mute in background switch

This commit is contained in:
TrueZhuanjia
2025-11-03 16:18:21 +08:00
parent a3f9e07cf7
commit e0c556da10
17 changed files with 158 additions and 25 deletions
+33 -11
View File
@@ -1186,6 +1186,26 @@
<constraint firstAttribute="height" constant="31" id="GWg-Dx-N44"/>
</constraints>
</stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="gBG-8F-6F8">
<rect key="frame" x="432" y="2349" width="281" height="31"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Duck Other Apps" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YPA-7E-Cdl" userLabel="uiLabel">
<rect key="frame" x="0.0" y="0.0" width="131" height="31"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YEv-1B-97I">
<rect key="frame" x="151" y="0.0" width="132" height="31"/>
<constraints>
<constraint firstAttribute="width" constant="130" id="LXO-Pc-PnJ"/>
</constraints>
</switch>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="31" id="6TQ-fK-dDd"/>
</constraints>
</stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="xbj-CP-fhP" userLabel="micVolumeStack">
<rect key="frame" x="440" y="2584" width="380" height="55.5"/>
<subviews>
@@ -1360,16 +1380,16 @@
</constraints>
</stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Oyk-L5-WTt" userLabel="singleTapSensitivityStack">
<rect key="frame" x="440" y="307" width="692" height="55.5"/>
<rect key="frame" x="440" y="307" width="700" height="55.5"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Single Tap Sensitivity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SuN-S2-8hj">
<rect key="frame" x="0.0" y="0.0" width="692" height="20.5"/>
<rect key="frame" x="0.0" y="0.0" width="700" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<slider verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="2" minValue="0.0" maxValue="5" minimumValueImage="0.square" catalog="system" maximumValueImage="5.square" translatesAutoresizingMaskIntoConstraints="NO" id="j4n-De-TRX" userLabel="Single Tap Sensitivity Slider">
<rect key="frame" x="-2" y="25.5" width="696" height="31"/>
<rect key="frame" x="-2" y="25.5" width="704" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="qOF-42-hPO"/>
</constraints>
@@ -1494,24 +1514,24 @@
<constraint firstAttribute="height" constant="31" id="m8h-w7-JRF"/>
</constraints>
</stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="gBG-8F-6F8">
<rect key="frame" x="432" y="2349" width="281" height="31"/>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="tNi-0x-k5z">
<rect key="frame" x="440" y="2670" width="302.5" height="31"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Duck Other Apps" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YPA-7E-Cdl" userLabel="uiLabel">
<rect key="frame" x="0.0" y="0.0" width="131" height="31"/>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Mute in Background" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hPX-cJ-dgH" userLabel="uiLabel">
<rect key="frame" x="0.0" y="0.0" width="152.5" height="31"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YEv-1B-97I">
<rect key="frame" x="151" y="0.0" width="132" height="31"/>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="WT0-Xz-Ldt">
<rect key="frame" x="172.5" y="0.0" width="132" height="31"/>
<constraints>
<constraint firstAttribute="width" constant="130" id="LXO-Pc-PnJ"/>
<constraint firstAttribute="width" constant="130" id="XPN-Mt-wLR"/>
</constraints>
</switch>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="31" id="6TQ-fK-dDd"/>
<constraint firstAttribute="height" constant="31" id="tTa-Lf-P8K"/>
</constraints>
</stackView>
</subviews>
@@ -1586,6 +1606,8 @@
<outlet property="mousePointerVelocityStack" destination="aQ8-4e-CQB" id="CW3-el-Yc3"/>
<outlet property="multiControllerStack" destination="RrU-mx-9jP" id="Axn-vT-LIf"/>
<outlet property="multiControllerSwitch" destination="8fR-vS-q3F" id="Sli-WG-kkI"/>
<outlet property="muteInBackgroundStack" destination="tNi-0x-k5z" id="tHI-f3-EXN"/>
<outlet property="muteInBackgroundSwitch" destination="WT0-Xz-Ldt" id="f1S-84-GB2"/>
<outlet property="navigationBar" destination="3qa-QW-sSl" id="CK1-rt-Reg"/>
<outlet property="onScreenWidgetSelector" destination="qSU-wh-tqA" id="j8d-fB-Z2c"/>
<outlet property="onScreenWidgetStack" destination="ziJ-RC-xkP" id="4Me-0o-H65"/>
+25 -3
View File
@@ -2214,16 +2214,16 @@
</constraints>
</stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="N0i-z6-WgC" userLabel="singleTapSensitivityStack">
<rect key="frame" x="437" y="2383" width="424" height="55.5"/>
<rect key="frame" x="437" y="2383" width="448" height="55.5"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Single Tap Sensitivity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WzD-wo-Wum">
<rect key="frame" x="0.0" y="0.0" width="424" height="20.5"/>
<rect key="frame" x="0.0" y="0.0" width="448" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<slider verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="2" minValue="0.0" maxValue="5" minimumValueImage="0.square" catalog="system" maximumValueImage="5.square" translatesAutoresizingMaskIntoConstraints="NO" id="uCa-Oa-7mv" userLabel="Single Tap Sensitivity Slider">
<rect key="frame" x="-2" y="25.5" width="428" height="31"/>
<rect key="frame" x="-2" y="25.5" width="452" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="XXP-GP-uhn"/>
</constraints>
@@ -2297,6 +2297,26 @@
<constraint firstAttribute="height" constant="31" id="ODv-4K-0el"/>
</constraints>
</stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="CWu-TP-Mce">
<rect key="frame" x="437" y="919" width="302.5" height="31"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Mute in Background" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PaG-9w-YxB" userLabel="uiLabel">
<rect key="frame" x="0.0" y="0.0" width="152.5" height="31"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1bU-9D-6uZ">
<rect key="frame" x="172.5" y="0.0" width="132" height="31"/>
<constraints>
<constraint firstAttribute="width" constant="130" id="KrG-en-SWf"/>
</constraints>
</switch>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="31" id="NIJ-yN-LNM"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
@@ -2370,6 +2390,8 @@
<outlet property="mousePointerVelocityStack" destination="VfU-iM-hP1" id="bgC-E9-tsz"/>
<outlet property="multiControllerStack" destination="qCV-3D-LnH" id="uGZ-L9-Wey"/>
<outlet property="multiControllerSwitch" destination="DWs-cm-vOl" id="Gaq-Vo-xZ2"/>
<outlet property="muteInBackgroundStack" destination="CWu-TP-Mce" id="b6k-2K-0ut"/>
<outlet property="muteInBackgroundSwitch" destination="1bU-9D-6uZ" id="ePh-7k-8Gi"/>
<outlet property="onScreenWidgetSelector" destination="UQu-Sg-YuF" id="FrG-7V-7Mg"/>
<outlet property="onScreenWidgetStack" destination="WvX-8P-JC1" id="md4-Yy-CmW"/>
<outlet property="onscreenControllerLabel" destination="5uF-E5-hpX" id="Ntz-sT-O6S"/>
+1
View File
@@ -128,6 +128,7 @@ typedef NS_ENUM(NSInteger, WidgetSizeTransition) {
audioEngine:(NSInteger)audioEngine
appendLeftClick:(BOOL)appendLeftClick
duckOtherApps:(BOOL)duckOtherApps
muteInBackground:(BOOL)muteInBackground
backgroundSessionTimer:(NSInteger)backgroundSessionTimer;
- (NSArray*) getHosts;
+2
View File
@@ -111,6 +111,7 @@
audioEngine:(NSInteger)audioEngine
appendLeftClick:(BOOL)appendLeftClick
duckOtherApps:(BOOL)duckOtherApps
muteInBackground:(BOOL)muteInBackground
backgroundSessionTimer:(NSInteger)backgroundSessionTimer{
[_managedObjectContext performBlockAndWait:^{
@@ -172,6 +173,7 @@
settingsToSave.audioEngine = [NSNumber numberWithInteger:audioEngine];
settingsToSave.appendLeftClick = appendLeftClick;
settingsToSave.duckOtherApps = duckOtherApps;
settingsToSave.muteInBackground = muteInBackground;
settingsToSave.rememberFoldState = rememberFoldState;
[self saveData];
}];
+1
View File
@@ -85,6 +85,7 @@
@property (nonatomic, retain) NSNumber * audioEngine;
@property (nonatomic) BOOL appendLeftClick;
@property (nonatomic) BOOL duckOtherApps;
@property (nonatomic) BOOL muteInBackground;
@property (nonatomic, retain) NSNumber * framePacingMode;
- (id) initFromSettings:(Settings*)settings;
+1
View File
@@ -142,6 +142,7 @@
self.audioEngine = settings.audioEngine;
self.appendLeftClick = settings.appendLeftClick;
self.duckOtherApps = settings.duckOtherApps;
self.muteInBackground = settings.muteInBackground;
#endif
return self;
@@ -57,6 +57,7 @@
<attribute name="micVolume" optional="YES" attributeType="Float" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
<attribute name="mousePointerVelocityFactor" optional="YES" attributeType="Float" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
<attribute name="multiController" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
<attribute name="muteInBackground" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
<attribute name="onscreenControls" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
<attribute name="optimizeGames" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
<attribute name="oscLayoutToolFingers" optional="YES" attributeType="Integer 16" defaultValueString="4" usesScalarValueType="NO" syncable="YES"/>
+3 -1
View File
@@ -19,6 +19,8 @@
#define CONN_TEST_SERVER "www.baidu.com"
@interface Connection : NSOperation <NSStreamDelegate>
@property (class, nonatomic, assign) bool muteInBackground;
@property (class, nonatomic, assign) bool useSystemAudioEngine;
-(id) initWithConfig:(StreamConfiguration*)config renderer:(VideoDecoderRenderer*)myRenderer connectionCallbacks:(id<ConnectionCallbacks>)callbacks;
-(void) terminate;
@@ -26,7 +28,7 @@
-(BandwidthTracker *) getBwTracker;
-(BOOL) getVideoStats:(video_stats_t*)stats;
-(NSString*) getActiveCodecName;
+ (void)setVolume:(float)newVolume;
+ (void)setUseSystemAudioEngine:(bool)useSysAudioEngine;
@end
+8
View File
@@ -56,6 +56,8 @@ static AVAudioPlayerNode *audioPlayerNode;
static AVAudioPCMBuffer *pcmBuffer;
static AVAudioFormat *audioFormat;
static bool muteInBackground;
static VideoDecoderRenderer* renderer;
static BandwidthTracker *bwTracker;
@@ -334,6 +336,10 @@ void ArCleanup(void)
volume = powf(linearVolume, exponent);
}
+ (void)setMuteInBackground:(bool)mute {
muteInBackground = mute;
}
+ (void)setUseSystemAudioEngine:(bool)useSysAudioEngine{
useSystemAudioEngine = useSysAudioEngine;
}
@@ -393,6 +399,8 @@ void AudioEngineInit(int sampleRate, int channelCount) {
void ArDecodeAndPlaySample(char* sampleData, int sampleLength)
{
if(appDidEnterBackgroundWithoutPip && muteInBackground) return;
int decodeLen;
// Don't queue if there's already more than 30 ms of audio data waiting
-1
View File
@@ -18,7 +18,6 @@
@property (atomic, readonly) PlotMetrics decodeMetrics;
@property (atomic, readonly) PlotMetrics frameQueueMetrics;
@property (atomic, assign) bool appDidEnterBackgroundWithoutPiP;
@property (nonatomic, strong, readonly) AVSampleBufferDisplayLayer *displayLayer;
+3 -3
View File
@@ -115,7 +115,7 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
NSLog(@"initializing video decoder %f", CACurrentMediaTime());
self = [super init];
_appDidEnterBackgroundWithoutPiP = false;
appDidEnterBackgroundWithoutPip = false;
_sq = dispatch_queue_create("com.moonlight.VideoDecoderRenderer",
dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INTERACTIVE, 0));
@@ -329,7 +329,7 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
// Legacy frame pacing callback - matches upstream/Integration behavior exactly
- (void)displayLinkCallback:(CADisplayLink *)sender
{
if(_appDidEnterBackgroundWithoutPiP) return;
if(appDidEnterBackgroundWithoutPip) return;
VIDEO_FRAME_HANDLE handle;
PDECODE_UNIT du;
@@ -379,7 +379,7 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
Log(LOG_I, @"Setting timebase for stream to %d / %d", pts.value, pts.timescale);
}
if(!_appDidEnterBackgroundWithoutPiP) [self->_displayLayer enqueueSampleBuffer:frame.sampleBuffer];
if(!appDidEnterBackgroundWithoutPip) [self->_displayLayer enqueueSampleBuffer:frame.sampleBuffer];
#ifdef DISPLAYLINK_VERBOSE
// Some OS-level metrics I'm not sure what to do with
@@ -187,6 +187,9 @@
@property (strong, nonatomic) IBOutlet UIStackView *duckOtherAppStack;
@property (strong, nonatomic) IBOutlet UISwitch *duckOtherAppSwitch;
@property (strong, nonatomic) IBOutlet UIStackView *muteInBackgroundStack;
@property (strong, nonatomic) IBOutlet UISwitch *muteInBackgroundSwitch;
@property (strong, nonatomic) IBOutlet UIStackView *testStack;
@property (nonatomic, strong) MicHandler *micHandler;
@@ -792,6 +792,7 @@ BOOL isCustomResolution(int resolutionSelected) {
[self addSetting:self.useBuiltinMicStack ofId:@"useBuiltinMicStack" withInfoTag:YES withDynamicLabel:NO to:audioSection];
[self addSetting:self.micVolumeStack ofId:@"micVolumeStack" withInfoTag:NO withDynamicLabel:YES to:audioSection];
[self addSetting:self.duckOtherAppStack ofId:@"duckOtherAppStack" withInfoTag:NO withDynamicLabel:NO to:audioSection];
[self addSetting:self.muteInBackgroundStack ofId:@"muteInBackgroundStack" withInfoTag:NO withDynamicLabel:NO to:audioSection];
// [self addSetting:self.audioEngineStack ofId:@"audioEngineStack" withInfoTag:YES withDynamicLabel:NO to:audioSection];
// cancel audio engine selector due to system engine is unable to playback multi-channel audio
[self addSetting:self.audioConfigStack ofId:@"audioConfigStack" withInfoTag:NO withDynamicLabel:NO to:audioSection];
@@ -1718,6 +1719,9 @@ BOOL isCustomResolution(int resolutionSelected) {
[self.duckOtherAppSwitch setOn:self->tempSettings.duckOtherApps];
[self.muteInBackgroundSwitch setOn:tempSettings.muteInBackground];
[self.muteInBackgroundSwitch addTarget:self action:@selector(muteInBackgroundSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
[self.micVolumeSlider setValue:self->tempSettings.micVolume.floatValue*100];
[self.micVolumeSlider addTarget:self action:@selector(micVolumeSliderMoved:) forControlEvents:UIControlEventValueChanged];
[self micVolumeSliderMoved:self.self.micVolumeSlider];
@@ -2387,6 +2391,10 @@ BOOL isCustomResolution(int resolutionSelected) {
});
}
- (void)muteInBackgroundSwitchFlipped:(UISwitch* )sender{
Connection.muteInBackground = sender.isOn;
}
- (void)redirectMicSwitchFlipped:(UISwitch* )sender{
if(sender.isOn) [self checkAndRequestMicPermission];
[self setHidden:!sender.isOn forStack:_useBuiltinMicStack];
@@ -2875,6 +2883,7 @@ BOOL isCustomResolution(int resolutionSelected) {
NSInteger audioEngine = self.audioEngineSelector.selectedSegmentIndex;
BOOL appendLeftClick = self.appendLeftClickSwitch.isOn;
BOOL duckOtherApps = self.duckOtherAppSwitch.isOn;
BOOL muteInBackground = self.muteInBackgroundSwitch.isOn;
NSInteger backgroundSessionTimer = self.backgroundSessionTimerSlider.value == self.backgroundSessionTimerSlider.maximumValue ? (uint32_t) INT16_MAX : (uint32_t)self.backgroundSessionTimerSlider.value;
[dataMan saveSettingsWithBitrate:_bitrate
@@ -2932,6 +2941,7 @@ BOOL isCustomResolution(int resolutionSelected) {
audioEngine:audioEngine
appendLeftClick:appendLeftClick
duckOtherApps:duckOtherApps
muteInBackground:muteInBackground
backgroundSessionTimer:backgroundSessionTimer];
}
@@ -374,7 +374,8 @@
}
else [micHandler stopTappingWithStopEngine:false];
[Connection setUseSystemAudioEngine:_settings.audioEngine.intValue == SystemAudioEngine];
Connection.useSystemAudioEngine = _settings.audioEngine.intValue == SystemAudioEngine;
Connection.muteInBackground = _settings.muteInBackground;
if(!viewJustLoaded) [_controllerSupport updateControllerSupport:self.streamConfig delegate:self];
// reload controllerSupport obj, this is mandatory for OSC reload,especially when the stream view is launched without OSC
@@ -1033,7 +1034,7 @@
- (void)applicationWillResignActive:(NSNotification *)notification {
//[self.pipController startPictureInPicture];
//sleep(1);
_streamMan.videoRenderer.appDidEnterBackgroundWithoutPiP = true;
appDidEnterBackgroundWithoutPip = true;
[_streamView saveRelocatedWidgetViews];
@@ -1050,7 +1051,7 @@
}
- (void)applicationDidBecomeActive:(NSNotification *)notification {
_streamMan.videoRenderer.appDidEnterBackgroundWithoutPiP = false;
appDidEnterBackgroundWithoutPip = false;
// Stop the background timer, since we're foregrounded again
if (_inactivityTimer != nil) {
Log(LOG_I, @"Stopping inactivity timer after becoming active again");
@@ -1083,9 +1084,9 @@
NSLog(@"did enter background, %d, %@, %d", _settings.enablePIP, self.pipController, self.pipController.isPictureInPictureActive);
if (_settings.enablePIP && self.pipController && self.pipController.isPictureInPictureActive) {
//Log(LOG_I, @"PIP is active, not terminating stream");
_streamMan.videoRenderer.appDidEnterBackgroundWithoutPiP = false;
appDidEnterBackgroundWithoutPip = false;
} else {
_streamMan.videoRenderer.appDidEnterBackgroundWithoutPiP = true;
appDidEnterBackgroundWithoutPip = true;
if ([_settings.renderingBackend intValue] == RENDER_METAL && self.metalViewController) {
Log(LOG_I, @"Pausing Metal renderer on background");
+30
View File
@@ -2419,6 +2419,36 @@
}
}
},
"hPX-cJ-dgH.text" : {
"comment" : "Class = \"UILabel\"; text = \"Mute in Background\"; ObjectID = \"hPX-cJ-dgH\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Mute in Background"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "后台静音"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "背景執行静音"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "背景執行静音"
}
}
}
},
"hq8-dy-8BF.text" : {
"comment" : "Class = \"UILabel\"; text = \"Custom Resolution\"; ObjectID = \"hq8-dy-8BF\";",
"extractionState" : "extracted_with_value",
+30
View File
@@ -3115,6 +3115,36 @@
}
}
},
"PaG-9w-YxB.text" : {
"comment" : "Class = \"UILabel\"; text = \"Mute in Background\"; ObjectID = \"PaG-9w-YxB\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Mute in Background"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "后台静音"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "背景執行静音"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "背景執行静音"
}
}
}
},
"Pdb-Bs-kMJ.text" : {
"comment" : "Class = \"UILabel\"; text = \"Statistics Overlay\"; ObjectID = \"Pdb-Bs-kMJ\";",
"extractionState" : "extracted_with_value",