瀏覽代碼

VLCKit: disable idle timer if player is playing media

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
Gleb Pinigin 12 年之前
父節點
當前提交
dd85bc2b79
共有 1 個文件被更改,包括 6 次插入0 次删除
  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"];
 }