Browse Source

MacOSX/Framework/VLCMediaPlayer.m: Fix KVO.

Pierre d'Herbemont 17 years ago
parent
commit
5fe3eb1c1d
1 changed files with 12 additions and 2 deletions
  1. 12 2
      Sources/VLCMediaPlayer.m

+ 12 - 2
Sources/VLCMediaPlayer.m

@@ -125,8 +125,18 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 @implementation VLCMediaPlayer
 @implementation VLCMediaPlayer
 
 
 /* Bindings */
 /* Bindings */
-+ (id)keysPathsForValuesAffectingPlaying { return [NSSet setWithObject:@"state"]; }
-+ (id)keysPathsForValuesAffectingSeekable { return [NSSet setWithObjects:@"state", @"media"]; }
++ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key
+{
+    static NSDictionary * dict = nil;
+    if( !dict )
+    {
+        dict = [[NSDictionary dictionaryWithObjectsAndKeys:
+            [NSSet setWithObject:@"state"], @"playing",
+            [NSSet setWithObjects:@"state", @"media", nil], @"seekable",
+            nil] retain];
+    }
+    return [dict objectForKey: key];
+}
 
 
 /* Contructor */
 /* Contructor */
 - (id)init
 - (id)init