Commit b1c9b44f authored by Vincent L. Cone's avatar Vincent L. Cone Committed by Felix Paul Kühne

tvOS: Disable VLCLocalNetworkServiceBrowserBonjour....

tvOS: Disable VLCLocalNetworkServiceBrowserBonjour. VLCLocalNetworkServiceBonjour does not implement any of the three optional methods in VLCLocalNetworkService. One of those is needed to actually browse the servers.
Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent a1617b83
......@@ -132,7 +132,7 @@
browsingCell.isDirectory = YES;
browsingCell.title = service.title;
browsingCell.titleLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption2];
browsingCell.subtitle = [self.discoveryController titleForSection:discoveryIndexPath.section];
browsingCell.subtitle = service.serviceName;
browsingCell.subtitleLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1];
UIImage *serviceIcon = service.icon;
browsingCell.thumbnailImage = serviceIcon ? serviceIcon : [UIImage imageNamed:@"serverIcon"];
......
......@@ -29,8 +29,9 @@
- (id<VLCLocalNetworkService>)networkServiceForIndex:(NSUInteger)index
{
VLCMedia *media = [self.mediaDiscoverer.discoveredMedia mediaAtIndex:index];
NSString *serviceName = media.url.scheme;
if (media)
return [[VLCLocalNetworkServiceBonjour alloc] initWithMediaItem:media];
return [[VLCLocalNetworkServiceBonjour alloc] initWithMediaItem:media serviceName:serviceName];
return nil;
}
......
......@@ -26,7 +26,7 @@
domain:@""];
}
- (VLCLocalNetworkServiceNetService *)localServiceForNetService:(NSNetService *)netService {
return [[VLCLocalNetworkServiceFTP alloc] initWithNetService:netService];
return [[VLCLocalNetworkServiceFTP alloc] initWithNetService:netService serviceName:self.self.name];
}
@end
......
......@@ -68,7 +68,7 @@
- (id<VLCLocalNetworkService>)networkServiceForIndex:(NSUInteger)index {
VLCMedia *media = [self.mediaDiscoverer.discoveredMedia mediaAtIndex:index];
if (media)
return [[VLCLocalNetworkServiceVLCMedia alloc] initWithMediaItem:media];
return [[VLCLocalNetworkServiceVLCMedia alloc] initWithMediaItem:media serviceName:self.serviceName];
return nil;
}
......
......@@ -108,7 +108,7 @@
[self addResolvedLocalNetworkService:localNetworkService];
}
- (VLCLocalNetworkServiceNetService *)localServiceForNetService:(NSNetService *)netService {
return [[VLCLocalNetworkServiceNetService alloc] initWithNetService:netService];
return [[VLCLocalNetworkServiceNetService alloc] initWithNetService:netService serviceName:self.name];
}
#pragma mark -
......
......@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - NetService based services
@interface VLCLocalNetworkServiceNetService : NSObject <VLCLocalNetworkService>
@property (nonatomic, readonly, strong) NSNetService *netService;
- (instancetype)initWithNetService:(NSNetService *)service;
- (instancetype)initWithNetService:(NSNetService *)service serviceName:(NSString *)serviceName;
@end
......
......@@ -18,12 +18,13 @@
@property (nonatomic, strong) NSNetService *netService;
@end
@implementation VLCLocalNetworkServiceNetService
- (instancetype)initWithNetService:(NSNetService *)service
@synthesize serviceName = _serviceName;
- (instancetype)initWithNetService:(NSNetService *)service serviceName:(nonnull NSString *)serviceName
{
self = [super init];
if (self) {
_netService = service;
_serviceName = serviceName;
}
return self;
}
......
......@@ -14,7 +14,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface VLCLocalNetworkServiceVLCMedia : NSObject <VLCLocalNetworkService>
- (instancetype)initWithMediaItem:(VLCMedia *)mediaItem;
- (instancetype)initWithMediaItem:(VLCMedia *)mediaItem serviceName:(NSString *)serviceName;
@property (nonatomic, readonly) VLCMedia *mediaItem;
@end
......
......@@ -17,11 +17,13 @@
@end
@implementation VLCLocalNetworkServiceVLCMedia
- (instancetype)initWithMediaItem:(VLCMedia *)mediaItem
@synthesize serviceName = _serviceName;
- (instancetype)initWithMediaItem:(VLCMedia *)mediaItem serviceName:(nonnull NSString *)serviceName
{
self = [super init];
if (self) {
_mediaItem = mediaItem;
_serviceName = serviceName;
}
return self;
}
......
......@@ -56,7 +56,7 @@
}
- (VLCLocalNetworkServiceNetService *)localServiceForNetService:(NSNetService *)netService {
return [[VLCLocalNetworkServiceHTTP alloc] initWithNetService:netService];
return [[VLCLocalNetworkServiceHTTP alloc] initWithNetService:netService serviceName:self.name];
}
@end
......
......@@ -26,7 +26,7 @@
self = [super init];
if (self) {
_name = @"Generic";
_loginItem = [[VLCLocalNetworkServiceItemLogin alloc] init];;
_loginItem = [[VLCLocalNetworkServiceItemLogin alloc] init];
}
return self;
}
......@@ -51,20 +51,23 @@
@end
@implementation VLCLocalNetworkServiceItemLogin
- (instancetype)initWithTile:(NSString *)title icon:(UIImage *)icon
@synthesize serviceName = _serviceName;
- (instancetype)initWithTile:(NSString *)title icon:(UIImage *)icon serviceName:(NSString *)serviceName
{
self = [super init];
if (self) {
_title = title;
_icon = icon;
_serviceName = serviceName;
}
return self;
}
- (instancetype)init
- (instancetype)initWithServiceName:(NSString *)serviceName
{
self = [self initWithTile:NSLocalizedString(@"CONNECT_TO_SERVER", nil)
icon:[UIImage imageNamed:@"vlc-sharing"]];
icon:[UIImage imageNamed:@"vlc-sharing"]
serviceName:serviceName];
if (self) {
}
......
......@@ -25,7 +25,7 @@
domain:@""];
}
- (VLCLocalNetworkServiceNetService *)localServiceForNetService:(NSNetService *)netService {
return [[VLCLocalNetworkServicePlex alloc] initWithNetService:netService];
return [[VLCLocalNetworkServicePlex alloc] initWithNetService:netService serviceName:self.name];
}
@end
......
......@@ -23,7 +23,7 @@
- (id<VLCLocalNetworkService>)networkServiceForIndex:(NSUInteger)index {
VLCMedia *media = [self.mediaDiscoverer.discoveredMedia mediaAtIndex:index];
if (media)
return [[VLCLocalNetworkServiceSAP alloc] initWithMediaItem:media];
return [[VLCLocalNetworkServiceSAP alloc] initWithMediaItem:media serviceName:self.name];
return nil;
}
......
......@@ -29,7 +29,7 @@
- (id<VLCLocalNetworkService>)networkServiceForIndex:(NSUInteger)index {
VLCMedia *media = [self.mediaDiscoverer.discoveredMedia mediaAtIndex:index];
if (media)
return [[VLCLocalNetworkServiceDSM alloc] initWithMediaItem:media];
return [[VLCLocalNetworkServiceDSM alloc] initWithMediaItem:media serviceName:self.name];
return nil;
}
......
......@@ -120,7 +120,7 @@
for (NSUInteger x = 0; x < count; x++) {
device = _UPNPdevices[x];
if ([[device urn] isEqualToString:@"urn:schemas-upnp-org:device:MediaServer:1"])
[mutArray addObject:[[VLCLocalNetworkServiceUPnP alloc] initWithUPnPDevice:device]];
[mutArray addObject:[[VLCLocalNetworkServiceUPnP alloc] initWithUPnPDevice:device serviceName:self.name]];
else
APLog(@"found device '%@' with unsupported urn '%@'", [device friendlyName], [device urn]);
}
......
......@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@class BasicUPnPDevice;
@interface VLCLocalNetworkServiceUPnP : NSObject <VLCLocalNetworkService>
- (instancetype)initWithUPnPDevice:(BasicUPnPDevice *)device;
- (instancetype)initWithUPnPDevice:(BasicUPnPDevice *)device serviceName:(NSString *)serviceName;
@end
NS_ASSUME_NONNULL_END
......@@ -21,12 +21,13 @@
@end
@implementation VLCLocalNetworkServiceUPnP
- (instancetype)initWithUPnPDevice:(BasicUPnPDevice *)device
@synthesize serviceName = _serviceName;
- (instancetype)initWithUPnPDevice:(BasicUPnPDevice *)device serviceName:(NSString *)serviceName
{
self = [super init];
if (self) {
_device = device;
_serviceName = serviceName;
}
return self;
}
......
......@@ -27,6 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
@required
@property (nonatomic, readonly, nullable) UIImage *icon;
@property (nonatomic, readonly) NSString *title;
@property (nonatomic, readonly) NSString *serviceName;
@optional
- (nullable id<VLCNetworkServerBrowser>)serverBrowser;
......
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