Ios GCKMediaControlChannel错误处理
在50%的情况下,当尝试在chromecast设备上流式传输音频/视频时,我会得到Ios GCKMediaControlChannel错误处理,ios,chromecast,google-cast,Ios,Chromecast,Google Cast,在50%的情况下,当尝试在chromecast设备上流式传输音频/视频时,我会得到mediaControlChannel:requestDidFailWithID:error:方法调用了大约100次,然后才真正开始流式传输 Error Domain=com.google.GCKError Code=4 "The operation couldn’t be completed. (com.google.GCKError error 4.) (事实上,我在电视上看到“蓝色进度线”的时候,似乎一直在
mediaControlChannel:requestDidFailWithID:error:
方法调用了大约100次,然后才真正开始流式传输
Error Domain=com.google.GCKError Code=4 "The operation couldn’t be completed. (com.google.GCKError error 4.)
(事实上,我在电视上看到“蓝色进度线”的时候,似乎一直在客户端收到此错误的回调)
在这种情况下,我们应该怎么做?通常,当您收到错误通知时,您应该处理它(即让用户知道某个错误失败),并且由您决定是否重试,但看起来chrome cast会为您决定并自动重试,直到成功。那么,对iOS客户端的期望是什么呢?我们应该忽略这些电话吗
更新:错误代码似乎在变化(我也得到了
1
,93
),但对于一个媒体项目,它们总是相同的。有人知道在哪里查找错误代码吗?没有这方面的任何信息。这里有一些说明:
您提到的错误代码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,
};