Explorar o código

VLCKit: disable idle timer if player is playing media

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
Gleb Pinigin %!s(int64=12) %!d(string=hai) anos
pai
achega
dd85bc2b79
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      Sources/VLCMediaPlayer.m

+ 6 - 0
Sources/VLCMediaPlayer.m

@@ -1046,6 +1046,12 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
 {
     [self willChangeValueForKey:@"state"];
     cachedState = [newState intValue];
+
+#if TARGET_OS_IPHONE
+    // Disable idle timer if player is playing media
+    // Exclusion can be made for audio only media
+    [UIApplication sharedApplication].idleTimerDisabled = [self isPlaying];
+#endif
     [self didChangeValueForKey:@"state"];
 }