【问题标题】:GCKMediaControlChannel error handlingGCKMediaControlChannel 错误处理
【发布时间】:2014-06-01 18:13:20
【问题描述】:

在 50% 的情况下,当尝试在 chromecast 设备上流式传输音频/视频时,我会在相同的 BEChromeCastMediaItem 实际开始流式传输之前调用大约 100mediaControlChannel:requestDidFailWithID:error: 方法。

Error Domain=com.google.GCKError Code=4 "The operation couldn’t be completed. (com.google.GCKError error 4.)

(实际上,我在电视上看到“蓝色进度线”的整个过程中,我一直在客户端收到带有此错误的回调)

在这种情况下我们应该怎么做?通常,当您收到有关错误的通知时,您应该处理它(即让用户知道某些事情失败了)并且由您决定是否要重试,但看起来 chrome cast 会为您决定并自动重试直到成功。那么对 iOS 客户端有什么期望呢?我们应该忽略这些电话吗?

更新:错误代码似乎发生了变化(我也收到了193),但对于一个媒体项目,它们总是相同的。有人知道在哪里查找错误代码吗? Class chrome.cast.Error 没有这方面的任何信息。

【问题讨论】:

    标签: ios chromecast google-cast


    【解决方案1】:

    这里有一些说明: https://developers.google.com/cast/docs/reference/ios/g_c_k_error_8h#aea7a716be62f301015e255e1ba63a9cc

    您提到的错误代码 4 看起来意味着发出了无效请求。

    如果你碰巧是为 iOS 编程,在 GCKError.h 文件中,我发现有一些额外的错误代码:

      typedef NS_ENUM(NSInteger, GCKErrorCode) {
    
      /**
       * Error code indicating a network I/O error.
       */
      GCKErrorCodeNetworkError = 1,
    
      /**
       * Error code indicating that an operation has timed out.
       */
      GCKErrorCodeTimeout = 2,
    
      /**
       * Error code indicating an authentication error.
       */
      GCKErrorCodeDeviceAuthenticationFailure = 3,
    
      /**
       * Error code indicating that an invalid request was made.
       */
      GCKErrorCodeInvalidRequest = 4,
    
      /**
       * Error code indicating that an in-progress request has been cancelled, most likely because
       * another action has preempted it.
       */
      GCKErrorCodeCancelled = 5,
    
      /**
       * Error code indicating that the request was disallowed and could not be completed.
       */
      GCKErrorCodeNotAllowed = 6,
    
      /**
       * Error code indicating that a requested application could not be found.
       */
      GCKErrorCodeApplicationNotFound = 7,
    
      /**
       * Error code indicating that a requested application is not currently running.
       */
      GCKErrorCodeApplicationNotRunning = 8,
    
      /**
       * Error code indicating the app entered the background.
       */
      GCKErrorCodeAppDidEnterBackground = 91,
    
      /**
       * Error code indicating a disconnection occurred during the request.
       */
      GCKErrorCodeDisconnected = 92,
    
      /**
       * Error code indicating that a request could not be made because the same type of request is
       * still in process.
       */
      GCKErrorCodeDuplicateRequest = 93,
    
      /**
       * Error code indicating that a media load failed on the receiver side.
       */
      GCKErrorCodeMediaLoadFailed = 94,
    
      /**
       * Error code indicating that a media media command failed because of the media player state.
       */
      GCKErrorCodeInvalidMediaPlayerState = 95,
    
      /**
       * Error code indicating that the application session ID was not valid.
       */
      GCKErrorCodeInvalidApplicationSessionID = 96,
    
      /**
       * Error code indicating that an unknown, unexpected error has occurred.
       */
      GCKErrorCodeUnknown = 99,
    };
    

    【讨论】:

      猜你喜欢
      • 2014-03-23
      • 1970-01-01
      • 2016-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-31
      相关资源
      最近更新 更多