From 85eacb28a0fe9198b389e8201e97497eca534e35 Mon Sep 17 00:00:00 2001 From: jeffgaogao Date: Fri, 13 Oct 2023 16:01:51 +0800 Subject: [PATCH] docs(TcgSdk): update api doc --- Classes/TCGGamePlayer.html | 2422 +++++++++++++++++++----------------- 1 file changed, 1249 insertions(+), 1173 deletions(-) diff --git a/Classes/TCGGamePlayer.html b/Classes/TCGGamePlayer.html index d6e58c3..ebc8f79 100644 --- a/Classes/TCGGamePlayer.html +++ b/Classes/TCGGamePlayer.html @@ -10,1185 +10,1261 @@ -
-
- -

- tcgsdk -

- -

- tencent -

- -
-
- - - -
-
-
-
-

TCGGamePlayer Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inTCGGamePlayer.h
TCGGamePlayer.m
- - - - - - -
- - - - - - -
-
- -

+ setLogger:withMinLevel: -

- -
-
- -
- - -
-

设置日志回调接收者及过滤等级

-
- - - -
+ (void)setLogger:(id<TCGLogDelegate>)logger withMinLevel:(TCGLogLevel)minLevel
- - - -
-

Parameters

- - - - - - - - - - - - -
logger

日志回调代理

minLevel

最低过滤日志等级

-
- - - - - - - -
-

Discussion

-

设置日志回调接收者及过滤等级

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– initWithParams:andDelegate: -

- -
-
- -
- - -
-

初始化本地资源,异步回调结果

-
- - - -
- (instancetype)initWithParams:(NSDictionary *)params andDelegate:(id<TCGGamePlayerDelegate>)listener
- - - -
-

Parameters

- - - - - - - - - - - - -
params

选填,预留暂未启用

listener

必填,player的代理,监听关键事件的回调

-
- - - - - - - -
-

Discussion

-

初始化本地资源,异步回调结果

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– startGameWithRemoteSession:error: -

- -
-
- -
- - -
-

开始与云端建立连接

-
- - - -
- (BOOL)startGameWithRemoteSession:(NSString *)remoteSession error:(NSError **)error
- - - -
-

Parameters

- - - - - - - - - - - - -
remoteSession

业务后台请求到的云端session信息

error

错误返回

-
- - - - - - - -
-

Discussion

-

开始与云端建立连接

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– stopGame -

- -
-
- -
- - -
-

结束游戏,释放本地资源。

-
- - - -
- (void)stopGame
- - - - - - - - - -
-

Discussion

-

结束游戏,释放本地资源。

云端资源在心跳断开90秒后自动释放,立即释放需业务后台主动调用接口。

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– restartGame -

- -
-
- -
- - -
-

重启云端的游戏应用程序

-
- - - -
- (void)restartGame
- - - - - - - - - -
-

Discussion

-

重启云端的游戏应用程序

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– pauseResumeGame: -

- -
-
- -
- - -
-

半退游戏,与云端的连接不主动断开,云端停止发送音视频数据。

-
- - - -
- (void)pauseResumeGame:(BOOL)doPause
- - - -
-

Parameters

- - - - - - - -
doPause

YES 半退游戏,NO 继续游戏

-
- - - - - - - -
-

Discussion

-

半退游戏,与云端的连接不主动断开,云端停止发送音视频数据。

云端游戏进程不暂停。 -与云端的连接,只是不主动断开,若因网络等原因断开后不触发自动重连

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– setStreamBitrateMix:max:fps: -

- -
-
- -
- - -
-

设置游戏视频的输出编码码率和帧率

-
- - - -
- (void)setStreamBitrateMix:(UInt32)minBitrate max:(UInt32)maxBitrate fps:(int)fps
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
minBitrate

范围[11000,151000],单位Kbps

maxBitrate

范围[11000,151000],单位Kbps

fps

范围[10,60],单位帧;

-
- - - - - - - -
-

Discussion

-

设置游戏视频的输出编码码率和帧率

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– setVolumeScale: -

- -
-
- -
- - -
-

设置远端声音的增益系数,默认为1.0保持源音量不变,2.0音量放大一倍

-
- - - -
- (void)setVolumeScale:(float)scale
- - - -
-

Parameters

- - - - - - - -
scale

[0.0 ~ 10.0]

-
- - - - - - - -
-

Discussion

-

设置远端声音的增益系数,默认为1.0保持源音量不变,2.0音量放大一倍

过度放大声音,会引起失真

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– setConnectTimeout: -

- -
-
- -
- - -
-

设置连接超时时长,在连接开始前设置才有效,默认10秒

-
- - - -
- (void)setConnectTimeout:(NSTimeInterval)timeout
- - - -
-

Parameters

- - - - - - - -
timeout

设置从连接远端开始到出画面的超时时长

-
- - - - - - - -
-

Discussion

-

设置连接超时时长,在连接开始前设置才有效,默认10秒

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– currentStatisReport -

- -
-
- -
- - -
-

获取当前的统计信息

-
- - - -
- (NSDictionary *)currentStatisReport
- - - - - -
-

Return Value

-

信息字典NSDictionary

-
- - - - - -
-

Discussion

-

获取当前的统计信息

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– setRemoteDesktopResolution:videoheight: -

- -
-
- -
- - -
-

修改云端桌面的分辨率,仅云端为PC Windows应用支持。修改后云端桌面的分辨率会改变为目标分辨率大小。 -如果客户端的gameView大小不变,修改分辨率后画面会有一定的拉伸/收缩。

-
- - - -
- (void)setRemoteDesktopResolution:(int)width videoheight:(int)height
- - - -
-

Parameters

- - - - - - - - - - - - -
width

需要修改到的目标云端桌面宽度

height

需要修改到的目标云端桌面高度

-
- - - - - - - -
-

Discussion

-

修改云端桌面的分辨率,仅云端为PC Windows应用支持。修改后云端桌面的分辨率会改变为目标分辨率大小。 -如果客户端的gameView大小不变,修改分辨率后画面会有一定的拉伸/收缩。

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– openCustomTransChannel:delegate: -

- -
-
- -
- - -
-

创建一个能与云端程序通讯的通道,最多允许存在三个通道。

-
- - - -
- (TCGCustomTransChannel *)openCustomTransChannel:(int)remotePort delegate:(id<TCGCustomTransChannelDelegate>)channelDelegate
- - - -
-

Parameters

- - - - - - - - - - - - -
remotePort

云端程序的UDP端口号

channelDelegate

通讯对象的代理,详情见TCGCustomTransChannelDelegate

-
- - - -
-

Return Value

-

TCGCustomTransChannel 通讯对象

-
- - - - - -
-

Discussion

-

创建一个能与云端程序通讯的通道,最多允许存在三个通道。

异步执行,通过TCGCustomTransChannelDelegate返回结果

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– videoView -

- -
-
- -
- - -
-

获取视频渲染的图层

-
- - - -
- (UIView *_Nullable)videoView
- - - - - -
-

Return Value

-

视频视图 UIView

-
- - - - - -
-

Discussion

-

获取视频渲染的图层

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– videoViewScale -

- -
-
- -
- - -
-

获取视频图层当前的放大系数

-
- - - -
- (CGFloat)videoViewScale
- - - - - -
-

Return Value

-

放大系数, 1.0表示没有缩放

-
- - - - - -
-

Discussion

-

获取视频图层当前的放大系数

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– setVideoViewEnablePinch: -

- -
-
- -
- - -
-

视频图层是否支持双指手势(放大、拖动)

-
- - - -
- (void)setVideoViewEnablePinch:(BOOL)isEnable
- - - -
-

Parameters

- - - - - - - -
isEnable

YES, 支持双指操作(放大、拖动);NO, 关闭手势识别。默认关闭

-
- - - - - - - -
-

Discussion

-

视频图层是否支持双指手势(放大、拖动)

当前只支持放大视图,当尝试缩小时可恢复成最初的样子。 -双指拖动时,可将视图拖移出屏幕

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– resetVideoViewFrame -

- -
-
- -
- - -
-

将视频图层恢复成缩放/拖动前的状态

-
- - - -
- (void)resetVideoViewFrame
- - - - - - - - - -
-

Discussion

-

将视频图层恢复成缩放/拖动前的状态

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– videoOrientation -

- -
-
- -
- - -
-

(手游) 获取视频画面内容的朝向

-
- - - -
- (UIInterfaceOrientation)videoOrientation
- - - - - -
-

Return Value

-

画面内容的朝向,UIInterfaceOrientationLandscapeRight 或 UIInterfaceOrientationPortrait

-
- - - - - -
-

Discussion

-

(手游) 获取视频画面内容的朝向

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
- -

– setVideoViewInsets: -

- -
-
- -
- - -
-

设置videoView在父视图上拖动的边缘间距,限制videoView不拖出视图。

-
- - - -
- (void)setVideoViewInsets:(UIEdgeInsets)insets
- - - -
-

Parameters

- - - - - - - -
insets

指定边缘间距。默认(100, 50, 50, 100)

-
- - - - - - - -
-

Discussion

-

设置videoView在父视图上拖动的边缘间距,限制videoView不拖出视图。

正值表示更接近矩形中心的边距,而负值表示远离中心的边距。

-
- - - - - - - -
-

Declared In

-

TCGGamePlayer.h

-
- - -
-
-
+
+
+ +
+ + +
+

获取视频渲染的图层

+
+ + + +
- (UIView *_Nullable)videoView
+ + + + + +
+

Return Value

+

视频视图 UIView

+
+ + + + + +
+

Discussion

+

获取视频渲染的图层

+
+ + + + + + + +
+

Declared In

+

TCGGamePlayer.h

+
+ + +
+
+
+ +

– videoViewScale +

+ +
+
+ +
+ + +
+

获取视频图层当前的放大系数

+
+ + + +
- (CGFloat)videoViewScale
+ + + + + +
+

Return Value

+

放大系数, 1.0表示没有缩放

+
+ + + + + +
+

Discussion

+

获取视频图层当前的放大系数

+
+ + + + + + + +
+

Declared In

+

TCGGamePlayer.h

+
+ + +
+
+
+ +

– setVideoViewEnablePinch: +

+ +
+
+ +
+ + +
+

视频图层是否支持双指手势(放大、拖动)

+
+ + + +
- (void)setVideoViewEnablePinch:(BOOL)isEnable
+ + + +
+

Parameters

+ + + + + + + +
isEnable

YES, 支持双指操作(放大、拖动);NO, 关闭手势识别。默认关闭

+
+ + + + + + + +
+

Discussion

+

视频图层是否支持双指手势(放大、拖动)

当前只支持放大视图,当尝试缩小时可恢复成最初的样子。 + 双指拖动时,可将视图拖移出屏幕

+
+ + + + + + + +
+

Declared In

+

TCGGamePlayer.h

+
+ + +
+
+
+ +

– resetVideoViewFrame +

+ +
+
+ +
+ + +
+

将视频图层恢复成缩放/拖动前的状态

+
+ + + +
- (void)resetVideoViewFrame
+ + + + + + + + + +
+

Discussion

+

将视频图层恢复成缩放/拖动前的状态

+
+ + + + + + + +
+

Declared In

+

TCGGamePlayer.h

+
+ + +
+
+
+ +

– videoOrientation +

+ +
+
+ +
+ + +
+

(手游) 获取视频画面内容的朝向

+
+ + + +
- (UIInterfaceOrientation)videoOrientation
+ + + + + +
+

Return Value

+

画面内容的朝向,UIInterfaceOrientationLandscapeRight 或 UIInterfaceOrientationPortrait

+
+ + + + + +
+

Discussion

+

(手游) 获取视频画面内容的朝向

+
+ + + + + + + +
+

Declared In

+

TCGGamePlayer.h

+
+ + +
-
- - - - - - -
- -
- -
-
+ +
+ + + + + + + + + -
+ + - + \ No newline at end of file