Skip to content

Commit 5e588da

Browse files
author
ranpeng
committed
v1.1.11
1 parent 8b16694 commit 5e588da

File tree

12 files changed

+71
-13
lines changed

12 files changed

+71
-13
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939

4040
## 说明文档
4141

42+
[接口文档](https://ex.cloud-gaming.myqcloud.com/cloud_gaming_web/docs/index.html)
43+
4244
[使用例子](samples/)
4345

4446
[快速入门](https://cloud.tencent.com/document/product/1162/46135)

README_EN-US.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ For more information, see the mobile and PC demos in the `samples` folder.
3939

4040
## Documentation
4141

42+
[Interface Documents](https://ex.cloud-gaming.myqcloud.com/cloud_gaming_web/docs_en/index.html)
43+
4244
[Use Samples](samples/)
4345

4446
[Getting Started](https://www.tencentcloud.com/document/product/1158/49612)

changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
### [1.1.11](https://github.com/tencentyun/cloudgame-js-sdk/releases/tag/v1.1.11)@2022.02.01
2+
3+
**新增**
4+
5+
- keyboard data 新增 location 表示左右按键
6+
7+
**变更**
8+
9+
- 重连优化
10+
11+
**修复**
12+
13+
- 重复多次开关麦,导致麦克风切换失败问题修复
14+
115
### [1.1.10](https://github.com/tencentyun/cloudgame-js-sdk/releases/tag/v1.1.10)@2022.12.02
216

317
**新增**

dist/tcg-sdk/index.d.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ export class TCGSDK {
13321332
* @example
13331333
* const { sendMessage, code } = await TCGSDK.createCustomDataChannel({
13341334
* destPort: 6060,
1335-
* onMessage: (res: any) => {
1335+
* onMessage: (res) => {
13361336
* console.log('CustomDataChannel onMessage', res);
13371337
* },
13381338
* });
@@ -1366,6 +1366,7 @@ export class TCGSDK {
13661366
* @param {Object} param
13671367
* @param {number} param.key - 对应的 code 码
13681368
* @param {boolean} param.down - 是否是按下状态
1369+
* @param {number} param.location - 1 左键,2 右键
13691370
*
13701371
* @example
13711372
* // 按下时
@@ -1374,7 +1375,7 @@ export class TCGSDK {
13741375
* TCGSDK.sendKeyboardEvent({key: 32, down: false});
13751376
*
13761377
*/
1377-
sendKeyboardEvent({ key, down }: { key: number; down: boolean }): void;
1378+
sendKeyboardEvent({ key, down, location }: { key: number; down: boolean; location?: number }): void;
13781379
/**
13791380
* 发送鼠标事件
13801381
* @param {Object} param
@@ -1490,6 +1491,9 @@ export class TCGSDK {
14901491
// -------------- 音视频控制相关接口 ------------
14911492
/**
14921493
* 设置码流参数,该接口为设置建议码流参数,云端可能会根据游戏动态调整
1494+
*
1495+
* **如果CreateSession 参数中设置了 MinBitrate/MaxBitrate,参数 min_bitrate/max_bitrate 必须在前者设置范围内**
1496+
*
14931497
* @param {Object} profile 目前可用参数如下:
14941498
* @param {number} profile.fps - 帧率,范围[10,60]
14951499
* @param {number} profile.max_bitrate - 最大码率,范围[1,15],单位:Mbps
@@ -1649,6 +1653,8 @@ export class TCGSDK {
16491653
/**
16501654
* 获取页面尺寸
16511655
*
1656+
* **可获取根据设备 window.devicePixelRatio 乘以固定比例保证显示画面分辨率足够清晰**
1657+
*
16521658
* @returns {Object} { width: number; height: number };
16531659
*
16541660
* @example

dist/tcg-sdk/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tcg-sdk/index_en.d.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,12 @@ export interface InitConfig {
645645
* @default '正在启动云渲染'
646646
*/
647647
loadingText?: string;
648+
/**
649+
* Restart button text
650+
*
651+
* @default '重新连接'
652+
*/
653+
restartText?: string;
648654
/**
649655
* Whether to rotate the entire HTML view. Default value: `false.
650656
*
@@ -978,6 +984,14 @@ export interface InitConfig {
978984
* @param {('portrait' | 'landscape')} response.type - current screen status
979985
*/
980986
onOrientationChange?: (response: { type: 'portrait' | 'landscape' }) => void;
987+
/**
988+
* Page visibility changes.
989+
*
990+
* @function
991+
* @param {Object} response - onVisibilityChange response
992+
* @param {('visible' | 'hidden')} response.status
993+
*/
994+
onVisibilityChange?: (response: { status: 'visible' | 'hidden' }) => void;
981995
/**
982996
* Cloud config changed, only trigger when status changed.
983997
*
@@ -1029,7 +1043,7 @@ export interface InitConfig {
10291043
*
10301044
* @function
10311045
* @param {Object} response - onConfigurationChange response
1032-
* @param {string} response.type - event type: 'idle' | 'noflow' | 'noflowcenter' | 'stats' | 'openurl' | 'latency'
1046+
* @param {string} response.type - event type: 'idle' | 'noflow' | 'noflowcenter' | 'stats' | 'openurl' | 'latency' | 'pointerlockerror'
10331047
* @param {any} response.data
10341048
*/
10351049
onEvent?: (response: OnEventResponse) => void;
@@ -1305,7 +1319,7 @@ export class TCGSDK {
13051319
* @example
13061320
* const { sendMessage, code } = await TCGSDK.createCustomDataChannel({
13071321
* destPort: 6060,
1308-
* onMessage: (res: any) => {
1322+
* onMessage: (res) => {
13091323
* console.log('CustomDataChannel onMessage', res);
13101324
* },
13111325
* });

plugin/joystick/joystick.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,16 @@ export interface JoystickOutputData {
124124
* @param {string} [params.joystickImage.frontPressed] - 按钮被按下后的图片, http/https 地址,不填采用默认图片
125125
* @param {boolean} [params.restJoystick=true] - touchend 后复位摇杆,默认值 `true`
126126
*
127-
* @example new Joystick({})
127+
* @example
128+
* // 如果是通过 Script 标签引入
129+
* const j = new CloudGamingPlugin.joystick({
130+
* zone: document.querySelector('#plugin-point'),
131+
* });
132+
*
133+
*
134+
* // 如果是通过 ES module import
135+
* const j = new Joystick({zone: document.querySelector('#plugin-point')})
136+
*
128137
*/
129138
declare class Joystick {
130139
constructor(params: JoystickConfig);

plugin/joystick/joystick.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/joystick/joystick_en.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,16 @@ export interface JoystickOutputData {
122122
* @param {string} [params.joystickImage.frontPressed] - The image of a pressed button, which is an HTTP/HTTPS address. If this parameter is not specified, the default image will be used.
123123
* @param {boolean} [params.restJoystick=true] - Whether to reset the stick after `touchend`. Default value: `true`.
124124
*
125-
* @example new Joystick({})
125+
* @example
126+
* // If import plugin from `Script tag`.
127+
* const j = new CloudGamingPlugin.joystick({
128+
* zone: document.querySelector('#plugin-point'),
129+
* });
130+
*
131+
*
132+
* // If import plugin from `ES module import`
133+
* const j = new Joystick({zone: document.querySelector('#plugin-point')})
134+
*
126135
*/
127136
declare class Joystick {
128137
constructor(params: JoystickConfig);

plugin/keyboard/keyboard.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface KeyboardConfig {
4747
* 依赖 TCGSDK 使用,建议在 TCGSDK.init 内的回调函数 onConnectSuccess 中使用
4848
*
4949
* @param {Object} params
50+
* @param {HTMLElement} [params.zone=TCGSDK init param `mount`] - 摇杆挂载节点,默认 TCGSDK init 参数传入的 mount 节点
5051
* @param {boolean} [params.sendData=true] - 自动发送键盘数据 默认值 true
5152
* @param {string} [params.keyBorderColor='#4a525a'] - 按键边框颜色 默认 '#4a525a'
5253
* @param {Object} [params.keyPressedBorderColor='#2684FF'] - 按下时边框颜色 默认 '#2684FF'

0 commit comments

Comments
 (0)