From 769840d0892f5a0885e05703c367000c5452c1c1 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 24 Sep 2019 17:37:35 -0700 Subject: [PATCH] Immediately stop streaming when resigning active on tvOS --- Limelight/ViewControllers/StreamFrameViewController.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m index f877874..c12fbd0 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.m +++ b/Limelight/ViewControllers/StreamFrameViewController.m @@ -164,6 +164,11 @@ [_inactivityTimer invalidate]; } +#if TARGET_OS_TV + // Terminate the stream immediately on tvOS + Log(LOG_I, @"Terminating stream after resigning active"); + [self returnToMainFrame]; +#else // Terminate the stream if the app is inactive for 10 seconds Log(LOG_I, @"Starting inactivity termination timer"); _inactivityTimer = [NSTimer scheduledTimerWithTimeInterval:10 @@ -171,6 +176,7 @@ selector:@selector(inactiveTimerExpired:) userInfo:nil repeats:NO]; +#endif } - (void)inactiveTimerExpired:(NSTimer*)timer {