|
@@ -12,6 +12,7 @@
|
|
|
|
|
|
#import "VLCPlaybackController+MediaLibrary.h"
|
|
|
#import <CoreData/CoreData.h>
|
|
|
+#import <VLCMediaLibraryKit/VLCMLFile.h>
|
|
|
|
|
|
@implementation VLCPlaybackController (MediaLibrary)
|
|
|
|
|
@@ -36,6 +37,11 @@
|
|
|
[self configureWithShowEpisode:(MLShowEpisode *)mediaObject];
|
|
|
}
|
|
|
|
|
|
+- (void)playMedia:(VLCMLMedia *)media
|
|
|
+{
|
|
|
+ [self configureMediaListWithMLMedia:@[media] indexToPlay:0];
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
Open a file in the libraryViewController without changing the playstate
|
|
|
|
|
@@ -130,6 +136,17 @@ Open a file in the libraryViewController without changing the playstate
|
|
|
[self configureMediaList:list atIndex:index];
|
|
|
}
|
|
|
|
|
|
+- (void)configureMediaListWithMLMedia:(NSArray<VLCMLMedia *> *)mlMedia indexToPlay:(int)index {
|
|
|
+ VLCMediaList *list = [[VLCMediaList alloc] init];
|
|
|
+ VLCMedia *media;
|
|
|
+ for (VLCMLMedia *file in mlMedia) {
|
|
|
+ media = [VLCMedia mediaWithURL: file.mainFile.mrl];
|
|
|
+ [media addOptions:self.mediaOptionsDictionary];
|
|
|
+ [list addMedia:media];
|
|
|
+ }
|
|
|
+ [self configureMediaList:list atIndex:index];
|
|
|
+}
|
|
|
+
|
|
|
- (void)configureMediaList:(VLCMediaList *)list atIndex:(int)index
|
|
|
{
|
|
|
[self playMediaList:list firstIndex:index subtitlesFilePath:nil];
|