Преглед изворни кода

macosx/framework: Implement -playMedia:.

Pierre d'Herbemont пре 16 година
родитељ
комит
95e7c4e8fa
2 измењених фајлова са 14 додато и 0 уклоњено
  1. 6 0
      Headers/Public/VLCMediaListPlayer.h
  2. 8 0
      Sources/VLCMediaListPlayer.m

+ 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;