gpt4 book ai didi

ios - GCKMediaControlChannel 错误处理

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:23:51 25 4
gpt4 key购买 nike

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

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没有这方面的任何信息。

最佳答案

这里有一些说明: 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,
};

关于ios - GCKMediaControlChannel 错误处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23133724/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com