Commit 1df3bc25 authored by Carola Nitz's avatar Carola Nitz

VLCTabBarCoordinator: make the VLCTabBarcoordinator the delegate of the VideoViewController

parent 89d688d2
......@@ -12,6 +12,7 @@
*****************************************************************************/
#import "VLCEqualizerView.h"
#import <MobileVLCKit/MobileVLCKit.h>
extern NSString *const VLCPlaybackControllerPlaybackDidStart;
extern NSString *const VLCPlaybackControllerPlaybackDidPause;
......
......@@ -11,7 +11,6 @@
*****************************************************************************/
@class VLCPlaybackController;
@protocol VLCVideoControllerDelegate;
typedef NS_ENUM(NSUInteger, VLCPlayerDisplayControllerDisplayMode) {
VLCPlayerDisplayControllerDisplayModeFullscreen,
......@@ -29,7 +28,7 @@ typedef NS_ENUM(NSUInteger, VLCPlayerDisplayControllerDisplayMode) {
@end
@interface VLCPlayerDisplayController : UIViewController <VLCVideoControllerDelegate>
@interface VLCPlayerDisplayController : UIViewController
+ (VLCPlayerDisplayController *)sharedInstance;
......
......@@ -15,7 +15,6 @@
#import "VLCMiniPlaybackView.h"
#import "VLCPlaybackNavigationController.h"
#import "VLCPlaybackController+MediaLibrary.h"
#import "VLC_iOS-Swift.h"
#if TARGET_OS_IOS
#import "VLCMovieViewController.h"
......@@ -359,11 +358,4 @@ static NSString *const VLCPlayerDisplayControllerDisplayModeKey = @"VLCPlayerDis
#endif
}
- (void)videoViewControllerDidSelectMediaObjectWithVLCVideoViewController:(VLCVideoViewController *)VLCVideoViewController mediaObject:(NSManagedObject *)mediaObject
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
[vpc playMediaLibraryObject:mediaObject];
// [self createSpotlightItem:mediaObject];
}
@end
......@@ -10,6 +10,7 @@
#import <XKKeychain/XKKeychain.h>
#import "VLCConstants.h"
#import "VLCPlayerDisplayController.h"
#import "VLCPlaybackController+MediaLibrary.h"
#import "VLCLibrarySearchDisplayDataSource.h"
#import "VLCServerListViewController.h"
#import "VLCSettingsController.h"
......
......@@ -16,7 +16,7 @@ protocol VLCTabbarCooordinatorDelegate {
}
class VLCTabbarCooordinator: NSObject {
class VLCTabbarCooordinator: NSObject, VLCVideoControllerDelegate {
private var childCoordinators: [NSObject] = []
private var tabBarController:UITabBarController
......@@ -33,7 +33,7 @@ class VLCTabbarCooordinator: NSObject {
public func setupViewControllers() {
let videoVC = VLCVideoViewController(collectionViewLayout: UICollectionViewFlowLayout())
//this should probably not be the delegate
videoVC.delegate = VLCPlayerDisplayController.sharedInstance()
videoVC.delegate = self
videoVC.title = NSLocalizedString("Video",comment: "")
videoVC.tabBarItem = UITabBarItem(
title: NSLocalizedString("Video",comment: ""),
......@@ -43,7 +43,7 @@ class VLCTabbarCooordinator: NSObject {
// Audio
let audioVC = VLCVideoViewController(collectionViewLayout: UICollectionViewFlowLayout())
//this should probably not be the delegate
audioVC.delegate = VLCPlayerDisplayController.sharedInstance()
audioVC.delegate = self
audioVC.title = NSLocalizedString("Audio",comment: "")
audioVC.tabBarItem = UITabBarItem(
title: NSLocalizedString("Audio",comment: ""),
......@@ -110,4 +110,11 @@ class VLCTabbarCooordinator: NSObject {
}
return nil
}
func videoViewControllerDidSelectMediaObject(VLCVideoViewController: VLCVideoViewController, mediaObject: NSManagedObject) {
let vpc = VLCPlaybackController.sharedInstance()
vpc?.playMediaLibraryObject(mediaObject)
// [self createSpotlightItem:mediaObject];
}
}
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