From 4a62c09504f2f61c5dfc732e76b85d68744a85eb Mon Sep 17 00:00:00 2001 From: Stephan Hesse Date: Fri, 4 May 2018 13:35:48 +0200 Subject: [PATCH] ios playback: introduce macro to enable photos/ library Until now the photo library integration is broken (that API was deprecated by Apple) and the iTunes integration is better to have optional to put our test files in the forefront (and have better way to browse large iTunes libs). --- playback/player/ios/GstPlay/LibraryViewController.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/playback/player/ios/GstPlay/LibraryViewController.m b/playback/player/ios/GstPlay/LibraryViewController.m index 330328f22f..ba7c2713a8 100644 --- a/playback/player/ios/GstPlay/LibraryViewController.m +++ b/playback/player/ios/GstPlay/LibraryViewController.m @@ -2,6 +2,8 @@ #import "VideoViewController.h" #import +#define ENABLE_IOS_LIBRARY false + @interface LibraryViewController () @end @@ -95,10 +97,14 @@ static NSString *CellIdentifier = @"CellIdentifier"; - (void)refreshMediaItems { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSAllDomainsMask, YES); + +#if ENABLE_IOS_LIBRARY + NSString *docsPath = [paths objectAtIndex:0]; + NSMutableArray *entries; /* Entries from the Photo Library */ - NSMutableArray *entries = [[NSMutableArray alloc] init]; + entries = [[NSMutableArray alloc] init]; ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) @@ -130,6 +136,8 @@ static NSString *CellIdentifier = @"CellIdentifier"; [entries addObject:[NSString stringWithFormat:@"file://%@/%@", docsPath, e]]; } self->mediaEntries = entries; +#endif + self->onlineEntries = [NSArray arrayWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"OnlineMedia" withExtension:@"plist"]]; }