minor fixes
This commit is contained in:
1 parent
b83811cc62
commit
6ea23d94cb
2 files changed
+24
-18
No files matched your search
@@ -74,6 +74,7 @@
|
|||||||
SettingsViewController* settingsViewController;
|
SettingsViewController* settingsViewController;
|
||||||
StreamFrameViewController* streamFrameViewController;
|
StreamFrameViewController* streamFrameViewController;
|
||||||
id navBarAppearanceStandard;
|
id navBarAppearanceStandard;
|
||||||
|
bool _viewJustAppeared;
|
||||||
|
|
||||||
NSTimer *_foregroundHostUpdateTimer;
|
NSTimer *_foregroundHostUpdateTimer;
|
||||||
|
|
||||||
@@ -1625,9 +1626,13 @@ static NSMutableSet* hostList;
|
|||||||
|
|
||||||
-(void)beginForegroundRefresh
|
-(void)beginForegroundRefresh
|
||||||
{
|
{
|
||||||
if (!_background) {
|
if (!_background || _viewJustAppeared) {
|
||||||
// This will kick off box art caching
|
// This will kick off box art caching
|
||||||
|
|
||||||
|
_viewJustAppeared = false;
|
||||||
|
|
||||||
|
[_foregroundHostUpdateTimer invalidate];
|
||||||
|
_foregroundHostUpdateTimer = nil;
|
||||||
|
|
||||||
_foregroundHostUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:5 repeats:YES block:^(NSTimer *timer) {
|
_foregroundHostUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:5 repeats:YES block:^(NSTimer *timer) {
|
||||||
[self updateHosts];
|
[self updateHosts];
|
||||||
@@ -1694,6 +1699,10 @@ static NSMutableSet* hostList;
|
|||||||
{
|
{
|
||||||
[super viewDidAppear:NO];
|
[super viewDidAppear:NO];
|
||||||
|
|
||||||
|
_viewJustAppeared = true;
|
||||||
|
|
||||||
|
[self beginForegroundRefresh];
|
||||||
|
|
||||||
// [self setupHostViewTitle];
|
// [self setupHostViewTitle];
|
||||||
// [self reloadScrollHostView]; //remove this for proper test
|
// [self reloadScrollHostView]; //remove this for proper test
|
||||||
[self attachWaterMark];
|
[self attachWaterMark];
|
||||||
@@ -1774,8 +1783,6 @@ static NSMutableSet* hostList;
|
|||||||
[self retrieveSavedHosts];
|
[self retrieveSavedHosts];
|
||||||
|
|
||||||
_discMan = [[DiscoveryManager alloc] initWithHosts:[hostList allObjects] andCallback:self];
|
_discMan = [[DiscoveryManager alloc] initWithHosts:[hostList allObjects] andCallback:self];
|
||||||
|
|
||||||
[self beginForegroundRefresh];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidDisappear:(BOOL)animated
|
- (void)viewDidDisappear:(BOOL)animated
|
||||||
|
|||||||
@@ -859,20 +859,7 @@
|
|||||||
//[self.pipController startPictureInPicture];
|
//[self.pipController startPictureInPicture];
|
||||||
//sleep(1);
|
//sleep(1);
|
||||||
|
|
||||||
if (_inactivityTimer != nil) {
|
|
||||||
[_inactivityTimer invalidate];
|
|
||||||
_inactivityTimer = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if !TARGET_OS_TV
|
#if !TARGET_OS_TV
|
||||||
// Terminate the stream if the app is inactive for 60 seconds
|
|
||||||
Log(LOG_I, @"Starting inactivity termination timer with %d min", _settings.backgroundSessionTimer.intValue);
|
|
||||||
_inactivityTimer = [NSTimer scheduledTimerWithTimeInterval:60*(double)_settings.backgroundSessionTimer.intValue
|
|
||||||
target:self
|
|
||||||
selector:@selector(inactiveTimerExpired:)
|
|
||||||
userInfo:nil
|
|
||||||
repeats:NO];
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -901,10 +888,22 @@
|
|||||||
|
|
||||||
NSLog(@"did enter background, %d, %@, %d", _settings.enablePIP, self.pipController, self.pipController.isPictureInPictureActive);
|
NSLog(@"did enter background, %d, %@, %d", _settings.enablePIP, self.pipController, self.pipController.isPictureInPictureActive);
|
||||||
if (_settings.enablePIP && self.pipController && self.pipController.isPictureInPictureActive) {
|
if (_settings.enablePIP && self.pipController && self.pipController.isPictureInPictureActive) {
|
||||||
Log(LOG_I, @"PIP is active, not terminating stream");
|
//Log(LOG_I, @"PIP is active, not terminating stream");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_inactivityTimer != nil) {
|
||||||
|
[_inactivityTimer invalidate];
|
||||||
|
_inactivityTimer = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Terminate the stream if the app is inactive for ...
|
||||||
|
Log(LOG_I, @"Starting inactivity termination timer with %d min", _settings.backgroundSessionTimer.intValue);
|
||||||
|
_inactivityTimer = [NSTimer scheduledTimerWithTimeInterval:60*(double)_settings.backgroundSessionTimer.intValue
|
||||||
|
target:self
|
||||||
|
selector:@selector(inactiveTimerExpired:)
|
||||||
|
userInfo:nil
|
||||||
|
repeats:NO];
|
||||||
|
|
||||||
#if !TARGET_OS_TV
|
#if !TARGET_OS_TV
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in new issue
Block a user