Commit 92e82ad0 authored by Carola Nitz's avatar Carola Nitz

VideoViewController: rename to MediaViewController

Since this controller is used for Audio and Video it makes sense to call him MediaController
parent 5721ddb7
......@@ -8,18 +8,18 @@
import Foundation
@objc public protocol VLCVideoControllerDelegate: class {
func videoViewControllerDidSelectMediaObject(VLCVideoViewController: VLCVideoViewController, mediaObject:NSManagedObject)
func videoViewControllerDidSelectSort(VLCVideoViewController: VLCVideoViewController)
@objc public protocol VLCMediaViewControllerDelegate: class {
func videoViewControllerDidSelectMediaObject(VLCMediaViewController: VLCMediaViewController, mediaObject:NSManagedObject)
func videoViewControllerDidSelectSort(VLCMediaViewController: VLCMediaViewController)
}
public class VLCVideoViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout, UISearchResultsUpdating, UISearchControllerDelegate
public class VLCMediaViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout, UISearchResultsUpdating, UISearchControllerDelegate
{
private var mediaDataSource: VLCMediaDataSource
private let cellPadding:CGFloat = 5.0
private var searchController: UISearchController?
private let searchDataSource = VLCLibrarySearchDisplayDataSource()
public weak var delegate: VLCVideoControllerDelegate?
public weak var delegate: VLCMediaViewControllerDelegate?
@available(iOS 11.0, *)
lazy var dragAndDropManager:VLCDragAndDropManager = {
......@@ -93,7 +93,7 @@ public class VLCVideoViewController: UICollectionViewController, UICollectionVie
}
@objc func sort() {
delegate?.videoViewControllerDidSelectSort(VLCVideoViewController: self)
delegate?.videoViewControllerDidSelectSort(VLCMediaViewController: self)
}
//MARK: - CollectionViewDelegate & DataSource
override public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
......@@ -101,7 +101,7 @@ public class VLCVideoViewController: UICollectionViewController, UICollectionVie
}
override public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
delegate?.videoViewControllerDidSelectMediaObject(VLCVideoViewController: self, mediaObject:mediaDataSource.object(at: UInt(indexPath.row)))
delegate?.videoViewControllerDidSelectMediaObject(VLCMediaViewController: self, mediaObject:mediaDataSource.object(at: UInt(indexPath.row)))
}
override public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
......
......@@ -40,7 +40,7 @@
static NSString *CellIdentifier = @"VLCMenuCell";
static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
@interface VLCMenuTableViewController () <UITableViewDataSource, UITableViewDelegate, VLCVideoControllerDelegate>
@interface VLCMenuTableViewController () <UITableViewDataSource, UITableViewDelegate, VLCMediaViewControllerDelegate>
{
NSArray *_sectionHeaderTexts;
NSArray *_menuItemsSectionOne;
......@@ -51,7 +51,7 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
NSLayoutConstraint *_heightConstraint;
NSLayoutConstraint *_leftTableConstraint;
VLCSettingsController *_settingsController;
VLCVideoViewController *_videoViewController;
VLCMediaViewController *_videoViewController;
}
@end
......@@ -232,10 +232,10 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
return _settingsController;
}
- (VLCVideoViewController *)videoViewController
- (VLCMediaViewController *)videoViewController
{
if (!_videoViewController) {
_videoViewController = [[VLCVideoViewController alloc] initWithCollectionViewLayout:[UICollectionViewFlowLayout new]];
_videoViewController = [[VLCMediaViewController alloc] initWithCollectionViewLayout:[UICollectionViewFlowLayout new]];
}
return _videoViewController;
}
......@@ -298,14 +298,14 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
if (motion == UIEventSubtypeMotionShake)
[[VLCBugreporter sharedInstance] handleBugreportRequest];
}
#pragma mark - VLCVideoControllerDelegate
#pragma mark - VLCMediaViewControllerDelegate
- (void)videoViewControllerDidSelectMediaObjectWithVLCVideoViewController:(VLCVideoViewController *)VLCVideoViewController mediaObject:(NSManagedObject *)mediaObject
- (void)videoViewControllerDidSelectMediaObjectWithVLCMediaViewController:(VLCMediaViewController *)VLCMediaViewController mediaObject:(NSManagedObject *)mediaObject
{
}
- (void)videoViewControllerDidSelectBackbuttonWithVLCVideoViewController:(VLCVideoViewController *)VLCVideoViewController {
- (void)videoViewControllerDidSelectBackbuttonWithVLCMediaViewController:(VLCMediaViewController *)VLCMediaViewController {
[[VLCSidebarController sharedInstance] toggleSidebar];
}
@end
......@@ -16,7 +16,7 @@ protocol VLCTabbarCooordinatorDelegate {
}
class VLCTabbarCooordinator: NSObject, VLCVideoControllerDelegate {
class VLCTabbarCooordinator: NSObject, VLCMediaViewControllerDelegate {
private var childCoordinators: [NSObject] = []
private var tabBarController:UITabBarController
......@@ -31,7 +31,7 @@ class VLCTabbarCooordinator: NSObject, VLCVideoControllerDelegate {
}
public func setupViewControllers() {
let videoVC = VLCVideoViewController(collectionViewLayout: UICollectionViewFlowLayout())
let videoVC = VLCMediaViewController(collectionViewLayout: UICollectionViewFlowLayout())
//this should probably not be the delegate
videoVC.delegate = self
videoVC.title = NSLocalizedString("Video",comment: "")
......@@ -41,7 +41,7 @@ class VLCTabbarCooordinator: NSObject, VLCVideoControllerDelegate {
selectedImage: UIImage(named: "TVShowsIcon"))
// Audio
let audioVC = VLCVideoViewController(collectionViewLayout: UICollectionViewFlowLayout())
let audioVC = VLCMediaViewController(collectionViewLayout: UICollectionViewFlowLayout())
//this should probably not be the delegate
audioVC.delegate = self
audioVC.title = NSLocalizedString("Audio",comment: "")
......@@ -111,7 +111,16 @@ class VLCTabbarCooordinator: NSObject, VLCVideoControllerDelegate {
return nil
}
func videoViewControllerDidSelectMediaObject(VLCVideoViewController: VLCVideoViewController, mediaObject: NSManagedObject) {
//MARK - VLCMediaViewControllerDelegate
func videoViewControllerDidSelectMediaObject(VLCMediaViewController: VLCMediaViewController, mediaObject: NSManagedObject) {
playMedia(media:mediaObject)
}
func videoViewControllerDidSelectSort(VLCMediaViewController: VLCMediaViewController) {
showSortOptions()
}
func playMedia(media: NSManagedObject) {
//that should go into a Coordinator itself
let displayController = VLCPlayerDisplayController()
tabBarController.addChildViewController(displayController)
......@@ -120,11 +129,7 @@ class VLCTabbarCooordinator: NSObject, VLCVideoControllerDelegate {
displayController.didMove(toParentViewController: tabBarController)
displayController.displayMode = .miniplayer
let vpc = VLCPlaybackController.sharedInstance()
vpc?.playMediaLibraryObject(mediaObject)
}
func videoViewControllerDidSelectSort(VLCVideoViewController: VLCVideoViewController) {
showSortOptions()
vpc?.playMediaLibraryObject(media)
}
func showSortOptions() {
......
......@@ -38,8 +38,8 @@
417E68BA1F321EFF00DB9BB2 /* VLCActivityViewControllerVendor.m in Sources */ = {isa = PBXBuildFile; fileRef = 417E68B81F321EFF00DB9BB2 /* VLCActivityViewControllerVendor.m */; };
4184AA151A5492070063DF5A /* VLCCloudStorageController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4184AA141A5492070063DF5A /* VLCCloudStorageController.m */; };
4187112B1F78F87200317B1A /* VLC_for_iOSTestVideoCodecs.m in Sources */ = {isa = PBXBuildFile; fileRef = 4187112A1F78F87200317B1A /* VLC_for_iOSTestVideoCodecs.m */; };
418B144720179C00000447AA /* VideoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 418B144620179C00000447AA /* VideoViewController.swift */; };
418B144820179C00000447AA /* VideoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 418B144620179C00000447AA /* VideoViewController.swift */; };
418B144720179C00000447AA /* MediaViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 418B144620179C00000447AA /* MediaViewController.swift */; };
418B144820179C00000447AA /* MediaViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 418B144620179C00000447AA /* MediaViewController.swift */; };
418B144D20179C75000447AA /* VLCTabBarCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 418B144C20179C74000447AA /* VLCTabBarCoordinator.swift */; };
418B144E20179C75000447AA /* VLCTabBarCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 418B144C20179C74000447AA /* VLCTabBarCoordinator.swift */; };
418B145020179CB9000447AA /* LayoutAnchorContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 418B144F20179CB9000447AA /* LayoutAnchorContainer.swift */; };
......@@ -809,7 +809,7 @@
4184AA131A5492070063DF5A /* VLCCloudStorageController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCCloudStorageController.h; path = Sources/VLCCloudStorageController.h; sourceTree = SOURCE_ROOT; };
4184AA141A5492070063DF5A /* VLCCloudStorageController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCCloudStorageController.m; path = Sources/VLCCloudStorageController.m; sourceTree = SOURCE_ROOT; };
4187112A1F78F87200317B1A /* VLC_for_iOSTestVideoCodecs.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLC_for_iOSTestVideoCodecs.m; sourceTree = "<group>"; };
418B144620179C00000447AA /* VideoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = VideoViewController.swift; path = Sources/VideoViewController.swift; sourceTree = SOURCE_ROOT; };
418B144620179C00000447AA /* MediaViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MediaViewController.swift; path = Sources/MediaViewController.swift; sourceTree = SOURCE_ROOT; };
418B144C20179C74000447AA /* VLCTabBarCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = VLCTabBarCoordinator.swift; path = Sources/VLCTabBarCoordinator.swift; sourceTree = SOURCE_ROOT; };
418B144F20179CB9000447AA /* LayoutAnchorContainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LayoutAnchorContainer.swift; path = Sources/LayoutAnchorContainer.swift; sourceTree = "<group>"; };
418B145220179CC2000447AA /* UINavigationController+VLC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UINavigationController+VLC.swift"; path = "Sources/UINavigationController+VLC.swift"; sourceTree = "<group>"; };
......@@ -2294,7 +2294,7 @@
7DEC8BE11BD686FA006E1093 /* Library */ = {
isa = PBXGroup;
children = (
418B144620179C00000447AA /* VideoViewController.swift */,
418B144620179C00000447AA /* MediaViewController.swift */,
7D37849C183A98DD009EE944 /* VLCThumbnailsCache.h */,
7D37849D183A98DD009EE944 /* VLCThumbnailsCache.m */,
DD7110EE1AF38B2B00854776 /* MLMediaLibrary+playlist.h */,
......@@ -3709,7 +3709,7 @@
7D51B3B01BF0EEF4005AF4D5 /* VLCPlaybackInfoMediaInfoTVViewController.m in Sources */,
7D13347C1BE132EA0012E919 /* VLCLocalNetworkServiceBrowserUPnP.m in Sources */,
7DC5A3E71BF6370800CFEBA8 /* VLCRemotePlaybackViewController.m in Sources */,
418B144820179C00000447AA /* VideoViewController.swift in Sources */,
418B144820179C00000447AA /* MediaViewController.swift in Sources */,
DDEAECF11BDFE9E800756C83 /* VLCServerListTVViewController.m in Sources */,
7DEC8BDE1BD67899006E1093 /* VLCFullscreenMovieTVViewController.m in Sources */,
7D1A2DB11BF66335002E0962 /* VLCMDFBrowsingArtworkProvider.m in Sources */,
......@@ -3822,7 +3822,7 @@
41F9BC7C1F4F20E400268461 /* VLCTrackSelectorView.m in Sources */,
7D378499183A98D1009EE944 /* VLCPlaylistCollectionViewCell.m in Sources */,
DD8F84311B00EB3B0009138A /* VLCPlaybackController+MediaLibrary.m in Sources */,
418B144720179C00000447AA /* VideoViewController.swift in Sources */,
418B144720179C00000447AA /* MediaViewController.swift in Sources */,
41EB91DD1F7BFF8500821AA5 /* VLCMetadata.m in Sources */,
DD3EFF551BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserDSM.m in Sources */,
7D37849A183A98D1009EE944 /* VLCPlaylistTableViewCell.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