Commit 30f7c58a authored by Carola Nitz's avatar Carola Nitz

first stab at new videoViewController

parent 40885878
//
// VideoViewController.swift
// VLC-iOS
//
// Created by Carola Nitz on 11/28/17.
// Copyright © 2017 VideoLAN. All rights reserved.
//
import Foundation
public protocol VLCVideoControllerDelegate: class {
func videoViewControllerDidSelectMediaObject(VLCVideoViewController: VLCVideoViewController, mediaObject:NSManagedObject)
}
public class VLCVideoViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout
{
private var mediaDataSource: VLCMediaDataSource
private let cellPadding:CGFloat = 5.0
public weak var delegate: VLCVideoControllerDelegate?
@available(iOS 11.0, *)
lazy var dragAndDropManager:VLCDragAndDropManager = {
let dragAndDropManager = VLCDragAndDropManager()
dragAndDropManager.delegate = mediaDataSource
return dragAndDropManager
}()
public convenience init(mediaDataSource:VLCMediaDataSource) {
self.init(collectionViewLayout: UICollectionViewFlowLayout())
self.mediaDataSource = mediaDataSource
}
public override init(collectionViewLayout layout: UICollectionViewLayout) {
self.mediaDataSource = VLCMediaDataSource()
super.init(collectionViewLayout: layout)
}
@available(*, unavailable)
required public init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override public func viewDidLoad() {
setupCollectionView()
setupNavigationbar()
_ = (MLMediaLibrary.sharedMediaLibrary() as AnyObject).perform(#selector(MLMediaLibrary.libraryDidAppear))
mediaDataSource.updateContents(forSelection: nil)
DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
self.mediaDataSource.addAllFolders()
self.mediaDataSource.addRemainingFiles()
self.collectionView?.reloadData()
}
}
func setupCollectionView(){
let playlistnib = UINib(nibName: "VLCPlaylistCollectionViewCell", bundle:nil)
collectionView?.register(playlistnib, forCellWithReuseIdentifier: VLCPlaylistCollectionViewCell.cellIdentifier())
collectionView?.backgroundColor = .white
if #available(iOS 11.0, *) {
collectionView?.dragDelegate = dragAndDropManager
collectionView?.dropDelegate = dragAndDropManager
}
}
func setupNavigationbar() {
title = "Videos"
if #available(iOS 11.0, *) {
navigationController?.navigationBar.prefersLargeTitles = true
let attributes = [NSAttributedStringKey.foregroundColor : UIColor.white]
navigationController?.navigationBar.largeTitleTextAttributes = attributes
}
self.navigationItem.leftBarButtonItem = UIBarButtonItem.themedRevealMenuButton(withTarget: self, andSelector: #selector(revealMenu))
}
@objc func revealMenu() {
VLCSidebarController.sharedInstance().toggleSidebar()
}
override public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
print(Int(mediaDataSource.numberOfFiles()))
return Int(mediaDataSource.numberOfFiles())
}
override public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
delegate?.videoViewControllerDidSelectMediaObject(VLCVideoViewController: self, mediaObject:mediaDataSource.object(at: UInt(indexPath.row)))
}
override public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
if let playlistCell = collectionView.dequeueReusableCell(withReuseIdentifier: VLCPlaylistCollectionViewCell.cellIdentifier(), for: indexPath) as? VLCPlaylistCollectionViewCell {
playlistCell.mediaObject = mediaDataSource.object(at: UInt(indexPath.row))
return playlistCell
}
return UICollectionViewCell()
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let numberofCells:CGFloat = self.traitCollection.horizontalSizeClass == .regular ? 3.0 : 2.0
let aspectRatio:CGFloat = 10.0 / 16.0
var cellWidth = view.bounds.size.width / numberofCells
cellWidth = cellWidth - ceil(((numberofCells + 1) * cellPadding) / numberofCells)
return CGSize(width:cellWidth, height:cellWidth * aspectRatio)
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsetsMake(cellPadding, cellPadding, cellPadding, cellPadding);
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return cellPadding
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return cellPadding
}
override public func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
collectionView?.collectionViewLayout.invalidateLayout()
}
}
......@@ -19,13 +19,13 @@
#import "VLCWatchCommunication.h"
#import <AppAuth/AppAuth.h>
@class VLCLibraryViewController;
@class VLCVideoViewController;
extern NSString *const VLCDropboxSessionWasAuthorized;
@interface VLCAppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic, readonly) VLCLibraryViewController *libraryViewController;
@property (nonatomic, readonly) VLCVideoViewController *videoViewController;
@property (nonatomic, readonly) VLCWatchCommunication *watchCommunication;
......
......@@ -27,7 +27,6 @@
#import <BoxSDK/BoxSDK.h>
#import "VLCPlaybackController.h"
#import "VLCPlaybackController+MediaLibrary.h"
#import "VLCPlayerDisplayController.h"
#import <MediaPlayer/MediaPlayer.h>
#import <HockeySDK/HockeySDK.h>
#import "VLCActivityManager.h"
......@@ -111,8 +110,7 @@ NSString *const VLCDropboxSessionWasAuthorized = @"VLCDropboxSessionWasAuthorize
void (^setupBlock)() = ^{
__weak typeof(self) weakSelf = self;
void (^setupLibraryBlock)() = ^{
_libraryViewController = [[VLCLibraryViewController alloc] init];
_videoViewController = [[VLCVideoViewController alloc] initWithCollectionViewLayout:[UICollectionViewFlowLayout new]];
appCoordinator = [[AppCoordinator alloc] initWithWindow:weakSelf.window];
[appCoordinator start];
};
......@@ -243,15 +241,7 @@ continueUserActivity:(NSUserActivity *)userActivity
if([userActivityType isEqualToString:kVLCUserActivityLibraryMode] ||
[userActivityType isEqualToString:kVLCUserActivityLibrarySelection]) {
VLCLibraryMode libraryMode = (VLCLibraryMode)[(NSNumber *)dict[@"state"] integerValue];
if (libraryMode <= VLCLibraryModeAllSeries) {
[[VLCSidebarController sharedInstance] selectRowAtIndexPath:[NSIndexPath indexPathForRow:libraryMode inSection:0]
scrollPosition:UITableViewScrollPositionTop];
[self.libraryViewController setLibraryMode:libraryMode];
}
[self.libraryViewController restoreUserActivityState:userActivity];
// [self.libraryViewController restoreUserActivityState:userActivity];
_isComingFromHandoff = YES;
return YES;
} else {
......@@ -302,96 +292,104 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
return YES;
}
if (_libraryViewController && url != nil) {
APLog(@"requested %@ to be opened", url);
if (url.isFileURL) {
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *directoryPath = searchPaths.firstObject;
NSURL *destinationURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", directoryPath, url.lastPathComponent]];
NSError *theError;
NSFileManager *manager = [NSFileManager defaultManager];
[[NSFileManager defaultManager] moveItemAtURL:url toURL:destinationURL error:&theError];
if (theError.code != noErr)
APLog(@"saving the file failed (%li): %@", (long)theError.code, theError.localizedDescription);
[[VLCMediaFileDiscoverer sharedInstance] updateMediaList];
NSURLRelationship relationship;
[manager getRelationship:&relationship ofDirectoryAtURL:[NSURL fileURLWithPath:directoryPath] toItemAtURL:url error:&theError];
if (relationship == NSURLRelationshipContains) {
[self playWithURL:url successCallback:nil errorCallback:nil];
}
} else if ([url.scheme isEqualToString:@"vlc-x-callback"] || [url.host isEqualToString:@"x-callback-url"]) {
// URL confirmes to the x-callback-url specification
// vlc-x-callback://x-callback-url/action?param=value&x-success=callback
APLog(@"x-callback-url with host '%@' path '%@' parameters '%@'", url.host, url.path, url.query);
NSString *action = [url.path stringByReplacingOccurrencesOfString:@"/" withString:@""];
NSURL *movieURL;
NSURL *successCallback;
NSURL *errorCallback;
NSString *fileName;
for (NSString *entry in [url.query componentsSeparatedByString:@"&"]) {
NSArray *keyvalue = [entry componentsSeparatedByString:@"="];
if (keyvalue.count < 2) continue;
NSString *key = keyvalue[0];
NSString *value = [keyvalue[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
if ([key isEqualToString:@"url"])
movieURL = [NSURL URLWithString:value];
else if ([key isEqualToString:@"filename"])
fileName = value;
else if ([key isEqualToString:@"x-success"])
successCallback = [NSURL URLWithString:value];
else if ([key isEqualToString:@"x-error"])
errorCallback = [NSURL URLWithString:value];
}
if ([action isEqualToString:@"stream"] && movieURL) {
[self playWithURL:movieURL successCallback:successCallback errorCallback:errorCallback];
}
else if ([action isEqualToString:@"download"] && movieURL) {
[self downloadMovieFromURL:movieURL fileNameOfMedia:fileName];
}
} else {
NSString *receivedUrl = [url absoluteString];
if ([receivedUrl length] > 6) {
NSString *verifyVlcUrl = [receivedUrl substringToIndex:6];
if ([verifyVlcUrl isEqualToString:@"vlc://"]) {
NSString *parsedString = [receivedUrl substringFromIndex:6];
NSUInteger location = [parsedString rangeOfString:@"//"].location;
/* Safari & al mangle vlc://http:// so fix this */
if (location != NSNotFound && [parsedString characterAtIndex:location - 1] != 0x3a) { // :
parsedString = [NSString stringWithFormat:@"%@://%@", [parsedString substringToIndex:location], [parsedString substringFromIndex:location+2]];
} else {
parsedString = [receivedUrl substringFromIndex:6];
if (![parsedString hasPrefix:@"http://"] && ![parsedString hasPrefix:@"https://"] && ![parsedString hasPrefix:@"ftp://"]) {
parsedString = [@"http://" stringByAppendingString:[receivedUrl substringFromIndex:6]];
}
}
url = [NSURL URLWithString:parsedString];
}
}
[[VLCSidebarController sharedInstance] selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
scrollPosition:UITableViewScrollPositionNone];
NSString *scheme = url.scheme;
if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"]) {
VLCAlertView *alert = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"OPEN_STREAM_OR_DOWNLOAD", nil) message:url.absoluteString cancelButtonTitle:NSLocalizedString(@"BUTTON_DOWNLOAD", nil) otherButtonTitles:@[NSLocalizedString(@"PLAY_BUTTON", nil)]];
alert.completion = ^(BOOL cancelled, NSInteger buttonIndex) {
if (cancelled)
[self downloadMovieFromURL:url fileNameOfMedia:nil];
else {
[self playWithURL:url successCallback:nil errorCallback:nil];
}
};
[alert show];
} else {
[self playWithURL:url successCallback:nil errorCallback:nil];
}
}
return YES;
}
// if (_libraryViewController && url != nil) {
// APLog(@"%@ requested %@ to be opened", sourceApplication, url);
//
// if (url.isFileURL) {
// NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
// NSString *directoryPath = searchPaths[0];
// NSURL *destinationURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", directoryPath, url.lastPathComponent]];
// NSError *theError;
// [[NSFileManager defaultManager] moveItemAtURL:url toURL:destinationURL error:&theError];
// if (theError.code != noErr)
// APLog(@"saving the file failed (%li): %@", (long)theError.code, theError.localizedDescription);
//
// [[VLCMediaFileDiscoverer sharedInstance] updateMediaList];
// } else if ([url.scheme isEqualToString:@"vlc-x-callback"] || [url.host isEqualToString:@"x-callback-url"]) {
// // URL confirmes to the x-callback-url specification
// // vlc-x-callback://x-callback-url/action?param=value&x-success=callback
// APLog(@"x-callback-url with host '%@' path '%@' parameters '%@'", url.host, url.path, url.query);
// NSString *action = [url.path stringByReplacingOccurrencesOfString:@"/" withString:@""];
// NSURL *movieURL;
// NSURL *successCallback;
// NSURL *errorCallback;
// NSString *fileName;
// for (NSString *entry in [url.query componentsSeparatedByString:@"&"]) {
// NSArray *keyvalue = [entry componentsSeparatedByString:@"="];
// if (keyvalue.count < 2) continue;
// NSString *key = keyvalue[0];
// NSString *value = [keyvalue[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
//
// if ([key isEqualToString:@"url"])
// movieURL = [NSURL URLWithString:value];
// else if ([key isEqualToString:@"filename"])
// fileName = value;
// else if ([key isEqualToString:@"x-success"])
// successCallback = [NSURL URLWithString:value];
// else if ([key isEqualToString:@"x-error"])
// errorCallback = [NSURL URLWithString:value];
// }
// if ([action isEqualToString:@"stream"] && movieURL) {
// VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
// vpc.fullscreenSessionRequested = YES;
//
// VLCMediaList *medialist = [[VLCMediaList alloc] init];
// [medialist addMedia:[VLCMedia mediaWithURL:movieURL]];
// vpc.successCallback = successCallback;
// vpc.errorCallback = errorCallback;
// [vpc playMediaList:medialist firstIndex:0 subtitlesFilePath:nil];
//
// }
// else if ([action isEqualToString:@"download"] && movieURL) {
// [self downloadMovieFromURL:movieURL fileNameOfMedia:fileName];
// }
// } else {
// NSString *receivedUrl = [url absoluteString];
// if ([receivedUrl length] > 6) {
// NSString *verifyVlcUrl = [receivedUrl substringToIndex:6];
// if ([verifyVlcUrl isEqualToString:@"vlc://"]) {
// NSString *parsedString = [receivedUrl substringFromIndex:6];
// NSUInteger location = [parsedString rangeOfString:@"//"].location;
//
// /* Safari & al mangle vlc://http:// so fix this */
// if (location != NSNotFound && [parsedString characterAtIndex:location - 1] != 0x3a) { // :
// parsedString = [NSString stringWithFormat:@"%@://%@", [parsedString substringToIndex:location], [parsedString substringFromIndex:location+2]];
// } else {
// parsedString = [receivedUrl substringFromIndex:6];
// if (![parsedString hasPrefix:@"http://"] && ![parsedString hasPrefix:@"https://"] && ![parsedString hasPrefix:@"ftp://"]) {
// parsedString = [@"http://" stringByAppendingString:[receivedUrl substringFromIndex:6]];
// }
// }
// url = [NSURL URLWithString:parsedString];
// }
// }
// [[VLCSidebarController sharedInstance] selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
// scrollPosition:UITableViewScrollPositionNone];
//
// NSString *scheme = url.scheme;
// if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"]) {
// VLCAlertView *alert = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"OPEN_STREAM_OR_DOWNLOAD", nil) message:url.absoluteString cancelButtonTitle:NSLocalizedString(@"BUTTON_DOWNLOAD", nil) otherButtonTitles:@[NSLocalizedString(@"PLAY_BUTTON", nil)]];
// alert.completion = ^(BOOL cancelled, NSInteger buttonIndex) {
// if (cancelled)
// [self downloadMovieFromURL:url fileNameOfMedia:nil];
// else {
// VLCMedia *media = [VLCMedia mediaWithURL:url];
// VLCMediaList *medialist = [[VLCMediaList alloc] init];
// [medialist addMedia:media];
// [[VLCPlaybackController sharedInstance] playMediaList:medialist firstIndex:0 subtitlesFilePath:nil];
// }
// };
// [alert show];
// } else {
// VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
// vpc.fullscreenSessionRequested = YES;
// VLCMediaList *medialist = [[VLCMediaList alloc] init];
// [medialist addMedia:[VLCMedia mediaWithURL:url]];
// [vpc playMediaList:medialist firstIndex:0 subtitlesFilePath:nil];
// }
// }
// return YES;
// }
return NO;
}
......@@ -411,7 +409,7 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
}
__weak typeof(self) weakself = self;
[self validatePasscodeIfNeededWithCompletion:^{
[weakself.libraryViewController updateViewContents];
//[weakself.libraryViewController updateViewContents];
if ([VLCPlaybackController sharedInstance].isPlaying){
[[VLCPlayerDisplayController sharedInstance] pushPlaybackView];
}
......@@ -423,7 +421,7 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
{
if (!_isRunningMigration && !_isComingFromHandoff) {
[[MLMediaLibrary sharedMediaLibrary] updateMediaDatabase];
[[VLCMediaFileDiscoverer sharedInstance] updateMediaList];
// [[VLCMediaFileDiscoverer sharedInstance] updateMediaList];
} else if(_isComingFromHandoff) {
_isComingFromHandoff = NO;
}
......@@ -448,20 +446,20 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
// TODO Should we update media db after adding new files?
[sharedLibrary updateMediaDatabase];
[_libraryViewController updateViewContents];
// [_libraryViewController updateViewContents];
}
}
- (void)mediaFileDeleted:(NSString *)name
{
[[MLMediaLibrary sharedMediaLibrary] updateMediaDatabase];
[_libraryViewController updateViewContents];
// [_libraryViewController updateViewContents];
}
- (void)mediaFilesFoundRequiringAdditionToStorageBackend:(NSArray<NSString *> *)foundFiles
{
[[MLMediaLibrary sharedMediaLibrary] addFilePaths:foundFiles];
[[(VLCAppDelegate *)[UIApplication sharedApplication].delegate libraryViewController] updateViewContents];
// [[(VLCAppDelegate *)[UIApplication sharedApplication].delegate libraryViewController] updateViewContents];
}
#pragma mark - pass code validation
......
......@@ -252,7 +252,7 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
} else if (itemIndex == 1)
viewController = [[VLCAboutViewController alloc] init];
} else {
viewController = appDelegate.libraryViewController;
viewController = appDelegate.videoViewController;
[(VLCLibraryViewController *)viewController setLibraryMode:(int)itemIndex];
}
......
......@@ -32,7 +32,7 @@
#import "VLCStatusLabel.h"
#import "VLCMovieViewControlPanelView.h"
#import "VLCSlider.h"
#import "VLCLibraryViewController.h"
#import "VLCTrackSelectorView.h"
#import "VLCMetadata.h"
#import "UIDevice+VLC.h"
......
......@@ -24,6 +24,10 @@ typedef NS_ENUM(NSUInteger, VLCPlayerDisplayControllerDisplayMode) {
@end
@protocol VLCPlayerDisplayControllerDelegate
@end
@interface VLCPlayerDisplayController : UIViewController
+ (VLCPlayerDisplayController *)sharedInstance;
......
......@@ -72,7 +72,7 @@ static NSString *const VLCPlayerDisplayControllerDisplayModeKey = @"VLCPlayerDis
[super viewDidLoad];
VLCSidebarController *sidebarVC = [VLCSidebarController sharedInstance];
VLCLibraryViewController *libCon = ((VLCAppDelegate *)[UIApplication sharedApplication].delegate).libraryViewController;
VLCVideoViewController *libCon = ((VLCAppDelegate *)[UIApplication sharedApplication].delegate).videoViewController;
UINavigationController *navCon = [[UINavigationController alloc] initWithRootViewController:libCon];
sidebarVC.contentViewController = navCon;
......
......@@ -35,5 +35,6 @@
- (void)selectionUpdate;
- (void)shake:(BOOL)shake;
- (void)showMetadata:(BOOL)showMeta;
+ (NSString *)cellIdentifier;
@end
......@@ -14,7 +14,6 @@
*****************************************************************************/
#import "VLCPlaylistCollectionViewCell.h"
#import "VLCLibraryViewController.h"
#import "VLCThumbnailsCache.h"
#import "NSString+SupportedMedia.h"
......@@ -41,6 +40,11 @@
[super awakeFromNib];
}
+ (NSString *)cellIdentifier
{
return @"PlaylistCell";
}
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
self.isSelectedView.hidden = !editing;
......@@ -61,28 +65,28 @@
- (void)shake:(BOOL)shake
{
if (shake) {
[UIView animateWithDuration:0.3 animations:^{
self.contentView.transform = CGAffineTransformMakeScale(0.9f, 0.9f);
}];
CAKeyframeAnimation* animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
CGFloat shakeAngle = 0.02f;
animation.values = @[@(-shakeAngle), @(shakeAngle)];
animation.autoreverses = YES;
animation.duration = 0.125;
animation.repeatCount = HUGE_VALF;
[[self layer] addAnimation:animation forKey:@"shakeAnimation"];
self.contentView.layer.cornerRadius = 10.0;
self.contentView.clipsToBounds = YES;
} else {
[UIView animateWithDuration:0.3 animations:^{
self.contentView.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
self.contentView.layer.cornerRadius = 0.0;
self.contentView.clipsToBounds = NO;
}];
[[self layer] removeAnimationForKey:@"shakeAnimation"];
}
// if (shake) {
// [UIView animateWithDuration:0.3 animations:^{
// self.contentView.transform = CGAffineTransformMakeScale(0.9f, 0.9f);
// }];
// CAKeyframeAnimation* animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
// CGFloat shakeAngle = 0.02f;
// animation.values = @[@(-shakeAngle), @(shakeAngle)];
// animation.autoreverses = YES;
// animation.duration = 0.125;
// animation.repeatCount = HUGE_VALF;
//
// [[self layer] addAnimation:animation forKey:@"shakeAnimation"];
// self.contentView.layer.cornerRadius = 10.0;
// self.contentView.clipsToBounds = YES;
// } else {
// [UIView animateWithDuration:0.3 animations:^{
// self.contentView.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
// self.contentView.layer.cornerRadius = 0.0;
// self.contentView.clipsToBounds = NO;
// }];
// [[self layer] removeAnimationForKey:@"shakeAnimation"];
// }
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
......@@ -307,11 +311,11 @@
} else
self.titleLabel.text = mediaFile.title;
VLCLibraryViewController *delegate = (VLCLibraryViewController*)self.collectionView.delegate;
// VLCLibraryViewController *delegate = (VLCLibraryViewController*)self.collectionView.delegate;
if (delegate.isEditing)
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@", [VLCTime timeWithNumber:[mediaFile duration]], [NSByteCountFormatter stringFromByteCount:[mediaFile fileSizeInBytes] countStyle:NSByteCountFormatterCountStyleFile]];
else {
// if (delegate.isEditing)
// self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@", [VLCTime timeWithNumber:[mediaFile duration]], [NSByteCountFormatter stringFromByteCount:[mediaFile fileSizeInBytes] countStyle:NSByteCountFormatterCountStyleFile]];
// else {
self.subtitleLabel.text = [NSString stringWithFormat:@"%@", [VLCTime timeWithNumber:[mediaFile duration]]];
if (mediaFile.videoTrack) {
NSString *width = [[mediaFile videoTrack] valueForKey:@"width"];
......@@ -319,7 +323,7 @@
if (width.intValue > 0 && height.intValue > 0)
self.subtitleLabel.text = [self.subtitleLabel.text stringByAppendingFormat:@" — %@x%@", width, height];
}
}
// }
[self _showPositionOfItem:mediaFile];
self.folderIconView.hidden = YES;
}
......
......@@ -13,7 +13,6 @@
*****************************************************************************/
#import "VLCSettingsController.h"
#import "VLCLibraryViewController.h"
#import "IASKSettingsReader.h"
#import "PAPasscodeViewController.h"
#import <LocalAuthentication/LocalAuthentication.h>
......
......@@ -17,6 +17,7 @@
26F1BFD01A770408001DF30C /* libMediaVLC.xml in Resources */ = {isa = PBXBuildFile; fileRef = 26F1BFCF1A770408001DF30C /* libMediaVLC.xml */; };
29125E5617492219003F03E5 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 29125E5417492219003F03E5 /* index.html */; };
2915544317490D4A00B86CAD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2915544217490D4A00B86CAD /* Security.framework */; };
4121A87F1FCDF79A0048F1ED /* VideoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4121A87E1FCDF79A0048F1ED /* VideoViewController.swift */; };
41251ED01FD0CF7900099110 /* AppCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41251ECE1FD0CF7900099110 /* AppCoordinator.swift */; };
41251ED11FD0CF7900099110 /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41251ECF1FD0CF7900099110 /* Coordinator.swift */; };
41273A3C1A955C4100A2EF77 /* VLCMigrationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 41273A3A1A955C4100A2EF77 /* VLCMigrationViewController.m */; };
......@@ -737,6 +738,7 @@
3C12F87F27BDCE3D0A58354E /* Pods-VLC-iOS-no-watch-Debug.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-VLC-iOS-no-watch-Debug.debug.xcconfig"; path = "Pods/Target Support Files/Pods-VLC-iOS-no-watch-Debug/Pods-VLC-iOS-no-watch-Debug.debug.xcconfig"; sourceTree = "<group>"; };
3DD533B1D45EEA70099433D8 /* libPods-VLC-iOS-no-watch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-VLC-iOS-no-watch.a"; sourceTree = BUILT_PRODUCTS_DIR; };
402E6F0E5362B530B7909338 /* libPods-VLC-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-VLC-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4121A87E1FCDF79A0048F1ED /* VideoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoViewController.swift; sourceTree = "<group>"; };
41251ECB1FD0C5C100099110 /* VLC-iOS-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "VLC-iOS-Bridging-Header.h"; sourceTree = SOURCE_ROOT; };
41251ECE1FD0CF7900099110 /* AppCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppCoordinator.swift; path = SharedSources/Coordinators/AppCoordinator.swift; sourceTree = SOURCE_ROOT; };
41251ECF1FD0CF7900099110 /* Coordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Coordinator.swift; path = SharedSources/Coordinators/Coordinator.swift; sourceTree = SOURCE_ROOT; };
......@@ -2282,6 +2284,7 @@
7DEC8BE11BD686FA006E1093 /* Library */ = {
isa = PBXGroup;
children = (
4121A87E1FCDF79A0048F1ED /* VideoViewController.swift */,
7D37849C183A98DD009EE944 /* VLCThumbnailsCache.h */,
7D37849D183A98DD009EE944 /* VLCThumbnailsCache.m */,
DD7110EE1AF38B2B00854776 /* MLMediaLibrary+playlist.h */,
......@@ -3771,6 +3774,7 @@
DD3EFF451BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserManualConnect.m in Sources */,
7DC19B051868D1C400810BF7 /* VLCFirstStepsFifthPageViewController.m in Sources */,
DD3EFF311BDEBCE500B68579 /* VLCNetworkServerBrowserFTP.m in Sources */,
4121A87F1FCDF79A0048F1ED /* VideoViewController.swift in Sources */,
9BADAF45185FBD9D00108BD8 /* VLCFrostedGlasView.m in Sources */,
41BBF9101FC31A8E003A72CB /* VLCDragAndDropManager.swift in Sources */,
DDC10BE41AEE8EA700890DC3 /* VLCTimeNavigationTitleView.m in Sources */,
......
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