Commit e8c7749c authored by Soomin Lee's avatar Soomin Lee

VLCPlaybackController+MediaLibrary: Basic link to new ML

parent 87f9ab7f
......@@ -11,8 +11,11 @@
*****************************************************************************/
#import "VLCPlaybackController.h"
#import <VLCMediaLibraryKit/VLCMLMedia.h>
@class NSManagedObject;
@interface VLCPlaybackController (MediaLibrary)
- (void)playMediaLibraryObject:(NSManagedObject *)mediaObject;
- (void)playMedia:(VLCMLMedia *)media;
- (void)openMediaLibraryObject:(NSManagedObject *)mediaObject;
@end
......@@ -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];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment