VLCLocalNetworkServiceBrowserBonjour.m 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*****************************************************************************
  2. * VLCLocalNetworkServiceBrowserBonjour.m
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2015 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Tobias Conradi <videolan # tobias-conradi.de>
  9. * Felix Paul Kühne <fkuehne # videolan.org>
  10. *
  11. * Refer to the COPYING file of the official project for license.
  12. *****************************************************************************/
  13. #import "VLCLocalNetworkServiceBrowserBonjour.h"
  14. #import "VLCNetworkServerLoginInformation.h"
  15. @implementation VLCLocalNetworkServiceBrowserBonjour
  16. - (instancetype)init
  17. {
  18. NSString *name = NSLocalizedString(@"BONJOUR_FILE_SERVERS", nil);
  19. self.mediaDiscoverer.libraryInstance.debugLogging = YES;
  20. return [super initWithName:name serviceServiceName:@"bonjour"];
  21. }
  22. - (id<VLCLocalNetworkService>)networkServiceForIndex:(NSUInteger)index
  23. {
  24. VLCMedia *media = [self.mediaDiscoverer.discoveredMedia mediaAtIndex:index];
  25. NSString *serviceName = media.url.scheme;
  26. if (media)
  27. return [[VLCLocalNetworkServiceBonjour alloc] initWithMediaItem:media serviceName:serviceName];
  28. return nil;
  29. }
  30. @end
  31. NSString *const VLCNetworkServerProtocolIdentifierBonjour = @"Bonjour";
  32. @implementation VLCLocalNetworkServiceBonjour
  33. - (UIImage *)icon
  34. {
  35. return [UIImage imageNamed:@"serverIcon"];
  36. }
  37. @end