Skip to content

Commit 6f41558

Browse files
author
ranpeng
committed
v1.1.1
v1.1.0
1 parent 069abb6 commit 6f41558

File tree

6 files changed

+146
-7
lines changed

6 files changed

+146
-7
lines changed

Diff for: changelog.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
### [1.1.1](https://github.com/tencentyun/cloudgame-js-sdk/releases/tag/v1.1.1)@2021.11.18
2+
3+
**变更**
4+
5+
- debug 面板增加audio 相关信息
6+
- init 参数 fullVideoToScreen 默认值改为 true,自动短边适配
7+
- 减弱对init 参数mobileGame 的依赖,由SDK 内部判断
8+
9+
**修复**
10+
11+
- 端游鼠标边界溢出后视图拉扯bug
12+
- 修复移动端touch 事件重复监听bug
13+
- iOS低版本,心跳问题
14+
115
### [1.1.0](https://github.com/tencentyun/cloudgame-js-sdk/releases/tag/v1.1.0)@2021.9.24
216

317
**新增**

Diff for: demo/demo.html

+16-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
width: 100%;
1818
height: 100%;
1919
overflow: hidden;
20-
font-family: "黑体", "Microsoft YaHei", "Arial", "sans-serif";
20+
font-family: '黑体', 'Microsoft YaHei', 'Arial', 'sans-serif';
2121
}
2222
</style>
2323
</head>
@@ -91,6 +91,21 @@
9191
onDisconnect: (res) => {
9292
console.log('onDisconnect', res);
9393
},
94+
// onTouch 回调,res 为 object[]
95+
// 移动端上操作端游应用,通过touch 模拟端游的鼠标操作
96+
onTouchEvent: (res) => {
97+
// 如果是手游方案,不需要这段逻辑,SDK 内部已经处理
98+
const { id, type, pageX, pageY } = res.pop();
99+
// 调用鼠标移动
100+
TCGSDK.mouseMove(id, type, pageX, pageY);
101+
// 模拟鼠标点击与抬起
102+
if (type === 'touchstart') {
103+
TCGSDK.sendMouseEvent({ type: 'mouseleft', down: true });
104+
}
105+
if (type === 'touchend' || type === 'touchcancel') {
106+
TCGSDK.sendMouseEvent({ type: 'mouseleft', down: false });
107+
}
108+
},
94109
onWebrtcStatusChange: (res) => {
95110
console.log('onWebrtcStatusChange', res);
96111
},

Diff for: demo/tcg-sdk/index.d.ts

+57-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ export interface OnNetworkChangeResponse {
4141
finish?: number;
4242
};
4343
}
44-
44+
/**
45+
* code=-1 localOffer 无法获取H264 编码
46+
* code=0 Success
47+
*/
4548
export interface OnInitSuccessResponse {
4649
readonly code: number;
47-
readonly msg: string;
50+
readonly msg?: string;
4851
readonly description?: any;
4952
}
5053

@@ -82,6 +85,7 @@ export interface ServerSideDescriptionFeatureSwitch {
8285
}
8386

8487
/**
88+
* code=-2 获取H264 编码失败
8589
* code=-1 setRemoteDescription 失败
8690
* code=0 请求正常
8791
* code=1 系统繁忙(可以重试)
@@ -109,6 +113,7 @@ export interface ServerSideDescription {
109113
readonly feature_switch?: ServerSideDescriptionFeatureSwitch;
110114
readonly role?: string;
111115
readonly metric_key?: string;
116+
readonly plat?: 'android' | 'pc';
112117
readonly sig_key?: string;
113118
readonly host_name?: string; // 只有手游有
114119
readonly screen_config?: {
@@ -324,6 +329,11 @@ export interface OnTouchEventResponse {
324329
*/
325330
readonly movementY: number;
326331
}
332+
333+
export interface OnEventResponse {
334+
readonly type: 'autoplay';
335+
readonly data: any;
336+
}
327337
export interface DebugSettingParams {
328338
/**
329339
* 打印键盘/鼠标键入的消息
@@ -420,6 +430,10 @@ export interface InitConfig extends InitConfigBase {
420430
* mobileMode false true 为使用接入手游,false 为适用端游
421431
*/
422432
mobileGame?: boolean;
433+
/**
434+
* 手游启用VPX 编码
435+
*/
436+
mobileVpx?: boolean;
423437
/**
424438
* 鼠标模式: 0 本地鼠标图片,1 云端下发鼠标图片,2 云端渲染
425439
*/
@@ -594,6 +608,10 @@ export interface InitConfig extends InitConfigBase {
594608
code: number;
595609
msg: 'NotFoundError' | 'NotAllowedError' | string;
596610
}) => void;
611+
/**
612+
* 事件回调
613+
*/
614+
onEvent?: (response: OnEventResponse) => void;
597615
}
598616

599617
export type MouseEvent = 'mousedeltamove' | 'mousemove' | 'mouseleft' | 'mouseright' | 'mousescroll';
@@ -940,6 +958,43 @@ export declare interface CloudGamingWebSDKStatic {
940958
* 性能数据上报开关
941959
*/
942960
toggleMetricReportBulk(start: boolean): void;
961+
// -------------- 多人云游相关接口 ------------
962+
/**
963+
* 获取所有坐席
964+
*/
965+
getSeats(): Promise<SeatsInfo>;
966+
/**
967+
* 申请切换角色或席位(非主机玩家)
968+
* 返回code 如下
969+
* 0: Success
970+
* -1: InvalidSeatIndex
971+
* -2: NoAuthorized
972+
* -3: NoSuchRole
973+
* -4: NoSuchUser
974+
* -5: AssignSeatFailed
975+
* -6: JsonParseFailed
976+
* -7: IgnoredHostSubmit
977+
*/
978+
submitSeatChange({ user_id, to_role, seat_index }: SeatChangeInfo): Promise<{ code: number }>;
979+
/**
980+
* 只有主机玩家才能调用该接口
981+
* 返回code 如下
982+
* 0: Success
983+
* -1: InvalidSeatIndex
984+
* -2: NoAuthorized
985+
* -3: NoSuchRole
986+
* -4: NoSuchUser
987+
* -5: AssignSeatFailed
988+
* -6: JsonParseFailed
989+
* -7: IgnoredHostSubmit
990+
*/
991+
seatChange({ user_id, to_role, seat_index }: SeatChangeInfo): Promise<{ code: number }>;
992+
/**
993+
*
994+
* @param status number, 0 管理员禁麦,此时只能管理员修改;1 自己主动禁麦,自己可以再次开启;2 开麦
995+
* @param user_id string 用户id
996+
*/
997+
changeMicStatus({ status, user_id }: { status: number; user_id: string }): Promise<ChangeMicStatusResponse>;
943998
}
944999

9451000
declare const TCGSDK: CloudGamingWebSDKStatic;

Diff for: demo/tcg-sdk/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/tcg-sdk/index.d.ts

+57-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ export interface OnNetworkChangeResponse {
4141
finish?: number;
4242
};
4343
}
44-
44+
/**
45+
* code=-1 localOffer 无法获取H264 编码
46+
* code=0 Success
47+
*/
4548
export interface OnInitSuccessResponse {
4649
readonly code: number;
47-
readonly msg: string;
50+
readonly msg?: string;
4851
readonly description?: any;
4952
}
5053

@@ -82,6 +85,7 @@ export interface ServerSideDescriptionFeatureSwitch {
8285
}
8386

8487
/**
88+
* code=-2 获取H264 编码失败
8589
* code=-1 setRemoteDescription 失败
8690
* code=0 请求正常
8791
* code=1 系统繁忙(可以重试)
@@ -109,6 +113,7 @@ export interface ServerSideDescription {
109113
readonly feature_switch?: ServerSideDescriptionFeatureSwitch;
110114
readonly role?: string;
111115
readonly metric_key?: string;
116+
readonly plat?: 'android' | 'pc';
112117
readonly sig_key?: string;
113118
readonly host_name?: string; // 只有手游有
114119
readonly screen_config?: {
@@ -324,6 +329,11 @@ export interface OnTouchEventResponse {
324329
*/
325330
readonly movementY: number;
326331
}
332+
333+
export interface OnEventResponse {
334+
readonly type: 'autoplay';
335+
readonly data: any;
336+
}
327337
export interface DebugSettingParams {
328338
/**
329339
* 打印键盘/鼠标键入的消息
@@ -420,6 +430,10 @@ export interface InitConfig extends InitConfigBase {
420430
* mobileMode false true 为使用接入手游,false 为适用端游
421431
*/
422432
mobileGame?: boolean;
433+
/**
434+
* 手游启用VPX 编码
435+
*/
436+
mobileVpx?: boolean;
423437
/**
424438
* 鼠标模式: 0 本地鼠标图片,1 云端下发鼠标图片,2 云端渲染
425439
*/
@@ -594,6 +608,10 @@ export interface InitConfig extends InitConfigBase {
594608
code: number;
595609
msg: 'NotFoundError' | 'NotAllowedError' | string;
596610
}) => void;
611+
/**
612+
* 事件回调
613+
*/
614+
onEvent?: (response: OnEventResponse) => void;
597615
}
598616

599617
export type MouseEvent = 'mousedeltamove' | 'mousemove' | 'mouseleft' | 'mouseright' | 'mousescroll';
@@ -940,6 +958,43 @@ export declare interface CloudGamingWebSDKStatic {
940958
* 性能数据上报开关
941959
*/
942960
toggleMetricReportBulk(start: boolean): void;
961+
// -------------- 多人云游相关接口 ------------
962+
/**
963+
* 获取所有坐席
964+
*/
965+
getSeats(): Promise<SeatsInfo>;
966+
/**
967+
* 申请切换角色或席位(非主机玩家)
968+
* 返回code 如下
969+
* 0: Success
970+
* -1: InvalidSeatIndex
971+
* -2: NoAuthorized
972+
* -3: NoSuchRole
973+
* -4: NoSuchUser
974+
* -5: AssignSeatFailed
975+
* -6: JsonParseFailed
976+
* -7: IgnoredHostSubmit
977+
*/
978+
submitSeatChange({ user_id, to_role, seat_index }: SeatChangeInfo): Promise<{ code: number }>;
979+
/**
980+
* 只有主机玩家才能调用该接口
981+
* 返回code 如下
982+
* 0: Success
983+
* -1: InvalidSeatIndex
984+
* -2: NoAuthorized
985+
* -3: NoSuchRole
986+
* -4: NoSuchUser
987+
* -5: AssignSeatFailed
988+
* -6: JsonParseFailed
989+
* -7: IgnoredHostSubmit
990+
*/
991+
seatChange({ user_id, to_role, seat_index }: SeatChangeInfo): Promise<{ code: number }>;
992+
/**
993+
*
994+
* @param status number, 0 管理员禁麦,此时只能管理员修改;1 自己主动禁麦,自己可以再次开启;2 开麦
995+
* @param user_id string 用户id
996+
*/
997+
changeMicStatus({ status, user_id }: { status: number; user_id: string }): Promise<ChangeMicStatusResponse>;
943998
}
944999

9451000
declare const TCGSDK: CloudGamingWebSDKStatic;

Diff for: dist/tcg-sdk/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)