VLCAppDelegate.m 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. /*****************************************************************************
  2. * VLCAppDelegate.m
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2013-2015 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  9. * Gleb Pinigin <gpinigin # gmail.com>
  10. * Jean-Romain Prévost <jr # 3on.fr>
  11. * Luis Fernandes <zipleen # gmail.com>
  12. * Carola Nitz <nitz.carola # googlemail.com>
  13. * Tamas Timar <ttimar.vlc # gmail.com>
  14. * Tobias Conradi <videolan # tobias-conradi.de>
  15. * Soomin Lee <TheHungryBu # gmail.com>
  16. *
  17. * Refer to the COPYING file of the official project for license.
  18. *****************************************************************************/
  19. #import "VLCAppDelegate.h"
  20. #import "VLCMediaFileDiscoverer.h"
  21. #import "NSString+SupportedMedia.h"
  22. #import "UIDevice+VLC.h"
  23. #import "VLCHTTPUploaderController.h"
  24. #import "VLCMigrationViewController.h"
  25. #import <BoxSDK/BoxSDK.h>
  26. #import "VLCPlaybackController.h"
  27. #import "VLCPlaybackController+MediaLibrary.h"
  28. #import <MediaPlayer/MediaPlayer.h>
  29. #import <HockeySDK/HockeySDK.h>
  30. #import "VLCActivityManager.h"
  31. #import "VLCDropboxConstants.h"
  32. #import "VLCDownloadViewController.h"
  33. #import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>
  34. #import "VLCPlaybackNavigationController.h"
  35. #import "PAPasscodeViewController.h"
  36. #import "VLC_iOS-Swift.h"
  37. NSString *const VLCDropboxSessionWasAuthorized = @"VLCDropboxSessionWasAuthorized";
  38. #define BETA_DISTRIBUTION 1
  39. @interface VLCAppDelegate () <VLCMediaFileDiscovererDelegate>
  40. {
  41. BOOL _isRunningMigration;
  42. BOOL _isComingFromHandoff;
  43. VLCKeychainCoordinator *_keychainCoordinator;
  44. AppCoordinator *appCoordinator;
  45. UITabBarController *rootViewController;
  46. }
  47. @end
  48. @implementation VLCAppDelegate
  49. + (void)initialize
  50. {
  51. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  52. NSDictionary *appDefaults = @{kVLCSettingPasscodeAllowFaceID : @(1),
  53. kVLCSettingPasscodeAllowTouchID : @(1),
  54. kVLCSettingContinueAudioInBackgroundKey : @(YES),
  55. kVLCSettingStretchAudio : @(NO),
  56. kVLCSettingTextEncoding : kVLCSettingTextEncodingDefaultValue,
  57. kVLCSettingSkipLoopFilter : kVLCSettingSkipLoopFilterNonRef,
  58. kVLCSettingSubtitlesFont : kVLCSettingSubtitlesFontDefaultValue,
  59. kVLCSettingSubtitlesFontColor : kVLCSettingSubtitlesFontColorDefaultValue,
  60. kVLCSettingSubtitlesFontSize : kVLCSettingSubtitlesFontSizeDefaultValue,
  61. kVLCSettingSubtitlesBoldFont: kVLCSettingSubtitlesBoldFontDefaultValue,
  62. kVLCSettingDeinterlace : kVLCSettingDeinterlaceDefaultValue,
  63. kVLCSettingHardwareDecoding : kVLCSettingHardwareDecodingDefault,
  64. kVLCSettingNetworkCaching : kVLCSettingNetworkCachingDefaultValue,
  65. kVLCSettingVolumeGesture : @(YES),
  66. kVLCSettingPlayPauseGesture : @(YES),
  67. kVLCSettingBrightnessGesture : @(YES),
  68. kVLCSettingSeekGesture : @(YES),
  69. kVLCSettingCloseGesture : @(YES),
  70. kVLCSettingVariableJumpDuration : @(NO),
  71. kVLCSettingVideoFullscreenPlayback : @(YES),
  72. kVLCSettingContinuePlayback : @(1),
  73. kVLCSettingContinueAudioPlayback : @(1),
  74. kVLCSettingFTPTextEncoding : kVLCSettingFTPTextEncodingDefaultValue,
  75. kVLCSettingWiFiSharingIPv6 : kVLCSettingWiFiSharingIPv6DefaultValue,
  76. kVLCSettingEqualizerProfile : kVLCSettingEqualizerProfileDefaultValue,
  77. kVLCSettingPlaybackForwardSkipLength : kVLCSettingPlaybackForwardSkipLengthDefaultValue,
  78. kVLCSettingPlaybackBackwardSkipLength : kVLCSettingPlaybackBackwardSkipLengthDefaultValue,
  79. kVLCSettingOpenAppForPlayback : kVLCSettingOpenAppForPlaybackDefaultValue,
  80. kVLCAutomaticallyPlayNextItem : @(YES)};
  81. [defaults registerDefaults:appDefaults];
  82. }
  83. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  84. {
  85. BITHockeyManager *hockeyManager = [BITHockeyManager sharedHockeyManager];
  86. [hockeyManager configureWithBetaIdentifier:@"0114ca8e265244ce588d2ebd035c3577"
  87. liveIdentifier:@"c95f4227dff96c61f8b3a46a25edc584"
  88. delegate:nil];
  89. [hockeyManager startManager];
  90. // Configure Dropbox
  91. [DBClientsManager setupWithAppKey:kVLCDropboxAppKey];
  92. [VLCApperanceManager setupAppearanceWithTheme:PresentationTheme.current];
  93. // Init the HTTP Server and clean its cache
  94. [[VLCHTTPUploaderController sharedInstance] cleanCache];
  95. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  96. rootViewController = [UITabBarController new];
  97. self.window.rootViewController = rootViewController;
  98. [self.window makeKeyAndVisible];
  99. // enable crash preventer
  100. void (^setupBlock)(void) = ^{
  101. void (^setupLibraryBlock)(void) = ^{
  102. self->appCoordinator = [[AppCoordinator alloc] initWithTabBarController:self->rootViewController];
  103. [self->appCoordinator start];
  104. };
  105. [self validatePasscodeIfNeededWithCompletion:setupLibraryBlock];
  106. BOOL spotlightEnabled = ![VLCKeychainCoordinator passcodeLockEnabled];
  107. [[MLMediaLibrary sharedMediaLibrary] setSpotlightIndexingEnabled:spotlightEnabled];
  108. [[MLMediaLibrary sharedMediaLibrary] applicationWillStart];
  109. VLCMediaFileDiscoverer *discoverer = [VLCMediaFileDiscoverer sharedInstance];
  110. NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  111. discoverer.directoryPath = [searchPaths firstObject];
  112. [discoverer addObserver:self];
  113. [discoverer startDiscovering];
  114. };
  115. NSError *error = nil;
  116. if ([[MLMediaLibrary sharedMediaLibrary] libraryMigrationNeeded]){
  117. _isRunningMigration = YES;
  118. VLCMigrationViewController *migrationController = [[VLCMigrationViewController alloc] initWithNibName:@"VLCMigrationViewController" bundle:nil];
  119. migrationController.completionHandler = ^{
  120. //migrate
  121. setupBlock();
  122. self->_isRunningMigration = NO;
  123. [[MLMediaLibrary sharedMediaLibrary] updateMediaDatabase];
  124. [[VLCMediaFileDiscoverer sharedInstance] updateMediaList];
  125. };
  126. self.window.rootViewController = migrationController;
  127. [self.window makeKeyAndVisible];
  128. } else {
  129. if (error != nil) {
  130. APLog(@"removed persistentStore since it was corrupt");
  131. NSURL *storeURL = ((MLMediaLibrary *)[MLMediaLibrary sharedMediaLibrary]).persistentStoreURL;
  132. [[NSFileManager defaultManager] removeItemAtURL:storeURL error:&error];
  133. }
  134. setupBlock();
  135. }
  136. /* add our static shortcut items the dynamic way to ease l10n and dynamic elements to be introduced later */
  137. if (@available(iOS 9, *)) {
  138. if (application.shortcutItems == nil || application.shortcutItems.count < 4) {
  139. UIApplicationShortcutItem *localLibraryItem = [[UIApplicationShortcutItem alloc] initWithType:kVLCApplicationShortcutLocalLibrary
  140. localizedTitle:NSLocalizedString(@"SECTION_HEADER_LIBRARY",nil)
  141. localizedSubtitle:nil
  142. icon:[UIApplicationShortcutIcon iconWithTemplateImageName:@"AllFiles"]
  143. userInfo:nil];
  144. UIApplicationShortcutItem *localServerItem = [[UIApplicationShortcutItem alloc] initWithType:kVLCApplicationShortcutLocalServers
  145. localizedTitle:NSLocalizedString(@"LOCAL_NETWORK",nil)
  146. localizedSubtitle:nil
  147. icon:[UIApplicationShortcutIcon iconWithTemplateImageName:@"Local"]
  148. userInfo:nil];
  149. UIApplicationShortcutItem *openNetworkStreamItem = [[UIApplicationShortcutItem alloc] initWithType:kVLCApplicationShortcutOpenNetworkStream
  150. localizedTitle:NSLocalizedString(@"OPEN_NETWORK",nil)
  151. localizedSubtitle:nil
  152. icon:[UIApplicationShortcutIcon iconWithTemplateImageName:@"OpenNetStream"]
  153. userInfo:nil];
  154. UIApplicationShortcutItem *cloudsItem = [[UIApplicationShortcutItem alloc] initWithType:kVLCApplicationShortcutClouds
  155. localizedTitle:NSLocalizedString(@"CLOUD_SERVICES",nil)
  156. localizedSubtitle:nil
  157. icon:[UIApplicationShortcutIcon iconWithTemplateImageName:@"iCloudIcon"]
  158. userInfo:nil];
  159. application.shortcutItems = @[localLibraryItem, localServerItem, openNetworkStreamItem, cloudsItem];
  160. }
  161. }
  162. return YES;
  163. }
  164. #pragma mark - Handoff
  165. - (BOOL)application:(UIApplication *)application willContinueUserActivityWithType:(NSString *)userActivityType
  166. {
  167. if ([userActivityType isEqualToString:kVLCUserActivityLibraryMode] ||
  168. [userActivityType isEqualToString:kVLCUserActivityPlaying] ||
  169. [userActivityType isEqualToString:kVLCUserActivityLibrarySelection])
  170. return YES;
  171. return NO;
  172. }
  173. - (BOOL)application:(UIApplication *)application
  174. continueUserActivity:(NSUserActivity *)userActivity
  175. restorationHandler:(void (^)(NSArray *))restorationHandler
  176. {
  177. NSString *userActivityType = userActivity.activityType;
  178. NSDictionary *dict = userActivity.userInfo;
  179. if([userActivityType isEqualToString:kVLCUserActivityLibraryMode] ||
  180. [userActivityType isEqualToString:kVLCUserActivityLibrarySelection]) {
  181. //TODO: Add restoreUserActivityState to the mediaviewcontroller
  182. _isComingFromHandoff = YES;
  183. return YES;
  184. } else {
  185. NSURL *uriRepresentation = nil;
  186. if ([userActivityType isEqualToString:CSSearchableItemActionType]) {
  187. uriRepresentation = [NSURL URLWithString:dict[CSSearchableItemActivityIdentifier]];
  188. } else {
  189. uriRepresentation = dict[@"playingmedia"];
  190. }
  191. if (!uriRepresentation) {
  192. return NO;
  193. }
  194. NSManagedObject *managedObject = [[MLMediaLibrary sharedMediaLibrary] objectForURIRepresentation:uriRepresentation];
  195. if (managedObject == nil) {
  196. APLog(@"%s file not found: %@",__PRETTY_FUNCTION__,userActivity);
  197. return NO;
  198. }
  199. [[VLCPlaybackController sharedInstance] openMediaLibraryObject:managedObject];
  200. return YES;
  201. }
  202. return NO;
  203. }
  204. - (void)application:(UIApplication *)application
  205. didFailToContinueUserActivityWithType:(NSString *)userActivityType
  206. error:(NSError *)error
  207. {
  208. if (error.code != NSUserCancelledError){
  209. //TODO: present alert
  210. }
  211. }
  212. - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
  213. {
  214. //Handles Dropbox Authorization flow.
  215. DBOAuthResult *authResult = [DBClientsManager handleRedirectURL:url];
  216. if (authResult != nil) {
  217. if ([authResult isSuccess]) {
  218. return YES;
  219. }
  220. }
  221. //Handles Google Authorization flow.
  222. if ([_currentGoogleAuthorizationFlow resumeAuthorizationFlowWithURL:url]) {
  223. _currentGoogleAuthorizationFlow = nil;
  224. return YES;
  225. }
  226. //TODO: we need a model of URLHandlers that registers with the VLCAppdelegate
  227. // then we can go through the list of handlers ask if they can handle the url and the first to say yes handles the call.
  228. // that way internal if elses get encapsulated
  229. /*
  230. protocol VLCURLHandler {
  231. func canHandleOpen(url: URL, options:[UIApplicationOpenURLOptionsKey:AnyObject]=[:]()) -> bool
  232. func performOpen(url: URL, options:[UIApplicationOpenURLOptionsKey:AnyObject]=[:]()) -> bool
  233. } */
  234. // if (_libraryViewController && url != nil) {
  235. // APLog(@"requested %@ to be opened", url);
  236. //
  237. // if (url.isFileURL) {
  238. // VLCDocumentClass *subclass = [[VLCDocumentClass alloc] initWithFileURL:url];
  239. // [subclass openWithCompletionHandler:^(BOOL success) {
  240. // [self playWithURL:url completion:^(BOOL success) {
  241. // [subclass closeWithCompletionHandler:nil];
  242. // }];
  243. // }];
  244. // } else if ([url.scheme isEqualToString:@"vlc-x-callback"] || [url.host isEqualToString:@"x-callback-url"]) {
  245. // // URL confirmes to the x-callback-url specification
  246. // // vlc-x-callback://x-callback-url/action?param=value&x-success=callback
  247. // APLog(@"x-callback-url with host '%@' path '%@' parameters '%@'", url.host, url.path, url.query);
  248. // NSString *action = [url.path stringByReplacingOccurrencesOfString:@"/" withString:@""];
  249. // NSURL *movieURL;
  250. // NSURL *successCallback;
  251. // NSURL *errorCallback;
  252. // NSString *fileName;
  253. // for (NSString *entry in [url.query componentsSeparatedByString:@"&"]) {
  254. // NSArray *keyvalue = [entry componentsSeparatedByString:@"="];
  255. // if (keyvalue.count < 2) continue;
  256. // NSString *key = keyvalue[0];
  257. // NSString *value = [keyvalue[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  258. //
  259. // if ([key isEqualToString:@"url"])
  260. // movieURL = [NSURL URLWithString:value];
  261. // else if ([key isEqualToString:@"filename"])
  262. // fileName = value;
  263. // else if ([key isEqualToString:@"x-success"])
  264. // successCallback = [NSURL URLWithString:value];
  265. // else if ([key isEqualToString:@"x-error"])
  266. // errorCallback = [NSURL URLWithString:value];
  267. // }
  268. // if ([action isEqualToString:@"stream"] && movieURL) {
  269. // [self playWithURL:movieURL completion:^(BOOL success) {
  270. // NSURL *callback = success ? successCallback : errorCallback;
  271. // if (@available(iOS 10, *)) {
  272. // [[UIApplication sharedApplication] openURL:callback options:@{} completionHandler:nil];
  273. // } else {
  274. //#pragma clang diagnostic push
  275. //#pragma clang diagnostic ignored "-Wdeprecated-declarations"
  276. // /* UIApplication's replacement calls require iOS 10 or later, which we can't enforce as of yet */
  277. // [[UIApplication sharedApplication] openURL:callback];
  278. //#pragma clang diagnostic pop
  279. // }
  280. // }];
  281. // }
  282. // else if ([action isEqualToString:@"download"] && movieURL) {
  283. // [self downloadMovieFromURL:movieURL fileNameOfMedia:fileName];
  284. // }
  285. // } else {
  286. // NSString *receivedUrl = [url absoluteString];
  287. // if ([receivedUrl length] > 6) {
  288. // NSString *verifyVlcUrl = [receivedUrl substringToIndex:6];
  289. // if ([verifyVlcUrl isEqualToString:@"vlc://"]) {
  290. // NSString *parsedString = [receivedUrl substringFromIndex:6];
  291. // NSUInteger location = [parsedString rangeOfString:@"//"].location;
  292. //
  293. // /* Safari & al mangle vlc://http:// so fix this */
  294. // if (location != NSNotFound && [parsedString characterAtIndex:location - 1] != 0x3a) { // :
  295. // parsedString = [NSString stringWithFormat:@"%@://%@", [parsedString substringToIndex:location], [parsedString substringFromIndex:location+2]];
  296. // } else {
  297. // parsedString = [receivedUrl substringFromIndex:6];
  298. // if (![parsedString hasPrefix:@"http://"] && ![parsedString hasPrefix:@"https://"] && ![parsedString hasPrefix:@"ftp://"]) {
  299. // parsedString = [@"http://" stringByAppendingString:[receivedUrl substringFromIndex:6]];
  300. // }
  301. // }
  302. // url = [NSURL URLWithString:parsedString];
  303. // }
  304. // }
  305. // [[VLCSidebarController sharedInstance] selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
  306. // scrollPosition:UITableViewScrollPositionNone];
  307. //
  308. // NSString *scheme = url.scheme;
  309. // if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"]) {
  310. // VLCAlertView *alert = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"OPEN_STREAM_OR_DOWNLOAD", nil) message:url.absoluteString cancelButtonTitle:NSLocalizedString(@"BUTTON_DOWNLOAD", nil) otherButtonTitles:@[NSLocalizedString(@"PLAY_BUTTON", nil)]];
  311. // alert.completion = ^(BOOL cancelled, NSInteger buttonIndex) {
  312. // if (cancelled)
  313. // [self downloadMovieFromURL:url fileNameOfMedia:nil];
  314. // else {
  315. // [self playWithURL:url completion:nil];
  316. // }
  317. // };
  318. // [alert show];
  319. // } else {
  320. // [self playWithURL:url completion:nil];
  321. // }
  322. // }
  323. // return YES;
  324. // }
  325. return NO;
  326. }
  327. - (void)applicationWillEnterForeground:(UIApplication *)application
  328. {
  329. [[MLMediaLibrary sharedMediaLibrary] applicationWillStart];
  330. }
  331. - (void)applicationWillResignActive:(UIApplication *)application
  332. {
  333. //Touch ID is shown
  334. if ([_window.rootViewController.presentedViewController isKindOfClass:[UINavigationController class]]){
  335. UINavigationController *navCon = (UINavigationController *)_window.rootViewController.presentedViewController;
  336. if ([navCon.topViewController isKindOfClass:[PAPasscodeViewController class]]){
  337. return;
  338. }
  339. }
  340. [self validatePasscodeIfNeededWithCompletion:^{
  341. //TODO: handle updating the videoview and
  342. if ([VLCPlaybackController sharedInstance].isPlaying){
  343. //TODO: push playback
  344. }
  345. }];
  346. [[MLMediaLibrary sharedMediaLibrary] applicationWillExit];
  347. }
  348. - (void)applicationDidBecomeActive:(UIApplication *)application
  349. {
  350. if (!_isRunningMigration && !_isComingFromHandoff) {
  351. [[MLMediaLibrary sharedMediaLibrary] updateMediaDatabase];
  352. // [[VLCMediaFileDiscoverer sharedInstance] updateMediaList];
  353. [[VLCPlaybackController sharedInstance] recoverDisplayedMetadata];
  354. } else if(_isComingFromHandoff) {
  355. _isComingFromHandoff = NO;
  356. }
  357. }
  358. - (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler
  359. {
  360. //TODO: shortcutItem should be implemented
  361. }
  362. #pragma mark - media discovering
  363. - (void)mediaFileAdded:(NSString *)fileName loading:(BOOL)isLoading
  364. {
  365. if (!isLoading) {
  366. MLMediaLibrary *sharedLibrary = [MLMediaLibrary sharedMediaLibrary];
  367. [sharedLibrary addFilePaths:@[fileName]];
  368. /* exclude media files from backup (QA1719) */
  369. NSURL *excludeURL = [NSURL fileURLWithPath:fileName];
  370. [excludeURL setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
  371. // TODO Should we update media db after adding new files?
  372. [sharedLibrary updateMediaDatabase];
  373. // TODO: update the VideoViewController
  374. }
  375. }
  376. - (void)mediaFileDeleted:(NSString *)name
  377. {
  378. [[MLMediaLibrary sharedMediaLibrary] updateMediaDatabase];
  379. // TODO: update the VideoViewController
  380. }
  381. - (void)mediaFilesFoundRequiringAdditionToStorageBackend:(NSArray<NSString *> *)foundFiles
  382. {
  383. [[MLMediaLibrary sharedMediaLibrary] addFilePaths:foundFiles];
  384. // TODO: update the VideoViewController
  385. }
  386. #pragma mark - pass code validation
  387. - (VLCKeychainCoordinator *)keychainCoordinator
  388. {
  389. if (!_keychainCoordinator) {
  390. _keychainCoordinator = [[VLCKeychainCoordinator alloc] init];
  391. }
  392. return _keychainCoordinator;
  393. }
  394. - (void)validatePasscodeIfNeededWithCompletion:(void(^)(void))completion
  395. {
  396. if ([VLCKeychainCoordinator passcodeLockEnabled]) {
  397. //TODO: Dimiss playback
  398. [self.keychainCoordinator validatePasscodeWithCompletion:completion];
  399. } else {
  400. completion();
  401. }
  402. }
  403. #pragma mark - download handling
  404. - (void)downloadMovieFromURL:(NSURL *)url
  405. fileNameOfMedia:(NSString *)fileName
  406. {
  407. [[VLCDownloadViewController sharedInstance] addURLToDownloadList:url fileNameOfMedia:fileName];
  408. //TODO: open DownloadViewController
  409. }
  410. #pragma mark - playback
  411. - (void)playWithURL:(NSURL *)url completion:(void (^ __nullable)(BOOL success))completion
  412. {
  413. VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
  414. vpc.fullscreenSessionRequested = YES;
  415. VLCMediaList *mediaList = [[VLCMediaList alloc] initWithArray:@[[VLCMedia mediaWithURL:url]]];
  416. [vpc playMediaList:mediaList firstIndex:0 subtitlesFilePath:nil completion:completion];
  417. }
  418. @end