Kaynağa Gözat

macosx/framework: Implement -playMedia:.

Pierre d'Herbemont 16 yıl önce
ebeveyn
işleme
95e7c4e8fa

+ 6 - 0
Headers/Public/VLCMediaListPlayer.h

@@ -32,4 +32,10 @@
  */
 - (void)play;
 - (void)stop;
+
+/**
+ * media must be in the current media list.
+ */
+- (void)playMedia:(VLCMedia *)media;
+
 @end

+ 8 - 0
Sources/VLCMediaListPlayer.m

@@ -88,6 +88,14 @@
     return _rootMedia;
 }
 
+- (void)playMedia:(VLCMedia *)media
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init(&ex);
+    libvlc_media_list_player_play_item(instance, [media libVLCMediaDescriptor], &ex);
+    catch_exception(&ex);    
+}
+
 - (void)play
 {
     libvlc_exception_t ex;