【问题标题】:Filtered google cast device scan yields nothing (iOS)过滤后的 google cast 设备扫描不会产生任何结果(iOS)
【发布时间】:2014-09-03 18:10:40
【问题描述】:

如果我在没有过滤器的情况下启动设备扫描仪,则可以找到 chromecast 设备并且一切正常。

如果我启动为我的应用过滤的设备扫描仪,我的理解是应该检测到运行该应用的 chromecast 设备。但是设备扫描没有产生任何结果(或者至少从未调用 deviceDidComeOnline 委托方法)。

在测试时,我的接收器已启动并在电视上运行(接收器应用支持标准媒体频道以及另一个命名空间为 urn:x-cast:com.mycompany.mychannel 的临时频道)

我做错了什么?

    // _filteredScanner and _filter are both 'strong' attributes of the class
    - (id) init {
      self = [super init];
      if (self != nil) {
        _filteredScanner = [[GCKDeviceScanner alloc] init] ;
        GCKFilterCriteria *myappRunningCriteria = [GCKFilterCriteria         criteriaForRunningApplicationWithID:nil supportedNamespaces:@[@"urn:x-cast:com.mycompany.mychannel", @"urn:x-cast:com.google.cast.media"]];
        _filter = [[GCKDeviceFilter alloc] initWithDeviceScanner: _filteredScanner criteria: myappRunningCriteria] ;
        [_filter addDeviceFilterListener:self];
        [_filteredScanner startScan] ;
      }
      return self ;
    }


    #pragma mark - GCKDeviceFilterListener
    - (void)deviceDidComeOnline:(GCKDevice *)device forDeviceFilter: (GCKDeviceFilter*)filter {
      NSLog(@"OK Device scanner filter found new device: %@", device.friendlyName);
    }

    - (void)deviceDidGoOffline:(GCKDevice *)device forDeviceFilter: (GCKDeviceFilter*) filter{
      NSLog(@"OK Device scanner filter reported device offline: %@", device.friendlyName);
    }

【问题讨论】:

  • 我想你的应用还没有发布?如果是这种情况,您的设备是否已在 Cast Developer Console 上针对您未发布的应用进行了配置?
  • @AliNaddaf 是的,该设备已在 Cast Developer Console 中注册开发(我可以在不使用过滤器时找到该设备,创建我的自定义频道,与接收器通信等......)跨度>
  • 如果您尝试仅使用 com.google.cast.media URN,它会出现在过滤器回调中吗? (同样,如果只是您自己的,它会出现吗)?
  • @IanBarber 我尝试了两个频道命名空间,只是我的临时命名空间和媒体频道,都没有成功
  • 您可以尝试传递应用程序 ID 而不是 nil,看看是否会触发?我很欣赏文档说可以为零!

标签: ios chromecast google-cast


【解决方案1】:

似乎这是 google Cast iOS SDK v2.3.0 中的一个错误,刚刚在 v2.4.0 中修复(请参阅bug report

【讨论】:

    猜你喜欢
    • 2014-07-21
    • 2015-09-12
    • 1970-01-01
    • 1970-01-01
    • 2021-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多