瀏覽代碼

VLCMediaListPlayer: add initWithOptions selector while retaining init's behavior

Felix Paul Kühne 11 年之前
父節點
當前提交
87069a369c
共有 4 個文件被更改,包括 21 次插入9 次删除
  1. 2 1
      Headers/Public/MobileVLCKit.h
  2. 1 0
      Headers/Public/VLCMediaListPlayer.h
  3. 3 0
      NEWS
  4. 15 8
      Sources/VLCMediaListPlayer.m

+ 2 - 1
Headers/Public/MobileVLCKit.h

@@ -1,7 +1,7 @@
 /*****************************************************************************
  * VLCKit: MobileVLCKit
  *****************************************************************************
- * Copyright (C) 2010-2012 Pierre d'Herbemont and VideoLAN
+ * Copyright (C) 2010-2013 Pierre d'Herbemont and VideoLAN
  *
  * Authors: Pierre d'Herbemont
  *
@@ -26,6 +26,7 @@
 #import <MobileVLCKit/VLCMediaDiscoverer.h>
 #import <MobileVLCKit/VLCMediaList.h>
 #import <MobileVLCKit/VLCMediaPlayer.h>
+#import <MobileVLCKit/VLCMediaListPlayer.h>
 #import <MobileVLCKit/VLCMediaThumbnailer.h>
 #import <MobileVLCKit/VLCTime.h>
 

+ 1 - 0
Headers/Public/VLCMediaListPlayer.h

@@ -55,6 +55,7 @@ typedef NSInteger VLCRepeatMode;
 @property (readwrite, retain) VLCMedia *rootMedia;
 @property (readonly, retain) VLCMediaPlayer *mediaPlayer;
 
+- (id)initWithOptions:(NSArray *)options;
 
 /**
  * Basic play and stop are here. For other method, use the mediaPlayer.

+ 3 - 0
NEWS

@@ -10,6 +10,7 @@ MobileVLCKit:
   party scripts
 - Added 2 sample projects illustrating video playback
 - Added support for https and hls playback
+- VLCMediaListPlayer is available now
 
 VLCKit:
 - VLCMediaThumbnailer is a public API on the Mac now matching the mobile
@@ -19,6 +20,8 @@ VLCKit:
 New APIs:
 - VLCMediaThumbnailer:
   - added property: snapshotPosition to overwrite the default
+- VLCMediaListPlayer:
+  - added initWithOptions selector matching VLCMediaPlayer's implementation
 
 Modified API behavior:
 - VLCMediaPlayer:

+ 15 - 8
Sources/VLCMediaListPlayer.m

@@ -31,16 +31,22 @@
 #import "VLCLibVLCBridging.h"
 
 @implementation VLCMediaListPlayer
-- (id)init
+
+- (id)initWithOptions:(NSArray *)options
 {
-    if (self = [super init])
-    {
-        _mediaPlayer = [[VLCMediaPlayer alloc] init];
+        if (self = [super init]) {
+            _mediaPlayer = [[VLCMediaPlayer alloc] initWithOptions:options];
+
+            instance = libvlc_media_list_player_new([VLCLibrary sharedInstance]);
+            libvlc_media_list_player_set_media_player(instance, [_mediaPlayer libVLCMediaPlayer]);
+        }
+        return self;
 
-        instance = libvlc_media_list_player_new([VLCLibrary sharedInstance]);
-        libvlc_media_list_player_set_media_player(instance, [_mediaPlayer libVLCMediaPlayer]);
-    }
-    return self;
+}
+
+- (id)init
+{
+    return [self initWithOptions:nil];
 }
 
 - (void)dealloc
@@ -51,6 +57,7 @@
     [_mediaList release];
     [super dealloc];
 }
+
 - (VLCMediaPlayer *)mediaPlayer
 {
     return _mediaPlayer;