- 开发者中心
- >
- 云游戏
- >
- 快速入门
- >
- 清晰度切换
- >
- iOS
清晰度切换
1 配置游戏清晰度
在海马云游戏管理平台进行配置游戏清晰度参数(高清、超清、流畅);
2 cloudPlayerSceneChangedCallback 回调函数
2.1 云游戏清晰度通知
开始游戏后会接收到当前游戏的清晰度
{
"sceneId": "resolution",
"extraInfo": {
"type": "notify",
"cur_rate": 1
}
}
字段 |
类型 |
type = “notify” |
播流清晰度通知 |
cur_rate |
当前清晰度ID |
2.2 获取游戏清晰度
{
"sceneId": "data",
"extraInfo": {
"type": "resolutions",
"data": ["##清晰度列表##"]
}
}
2.3 切换清晰度
{
"sceneId": "resolution",
"extraInfo": {
"type": "crst",
"source": 1,
"des": 3,
"method": 1,
"title": "##提示##"
}
}
字段 |
类型 |
type = “crst” |
开始切换清晰度 |
source |
当前清晰度ID |
des |
目标清晰度ID |
method |
0 - 手动切换 ;1 - 自动切换 |
手动切换清晰度调用
- (void) switchResolution:(NSInteger)resolutionId;
2.4 清晰度切换完成
{
"sceneId": "resolution",
"extraInfo": {
"type": "cred",
"cur_rate": 1,
"result": 1,
"title": "##提示##"
}
}
字段 |
类型 |
type = “cred” |
游戏卡断 |
cur_rate |
是否已经在最低码率 1 - 是 ;0 - 否 |
result |
0 - 失败 1 - 成功 |
2.5 游戏卡断,建议用户切换清晰度
{
"sceneId": "resolution",
"extraInfo": {
"type": "crtp",
"minimum": 1,
"delay_less_minimum": 1,
"title": "##提示##"
}
}
字段 |
类型 |
type = “crtp” |
游戏卡断 |
minimum |
是否已经在最低码率 1 - 是 ;0 - 否 |
delay_less_minimum |
当前码率是否是最低码率 否-“0” 是-“1” |