@polyvharmony/rtc-sdk 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/Index.d.ts +9 -0
- package/LICENSE +20 -0
- package/README.md +13 -0
- package/ResourceTable.txt +1 -0
- package/ets/modules.abc +0 -0
- package/obfuscation.txt +2 -0
- package/oh-package.json5 +1 -0
- package/package.json +1 -0
- package/src/main/ets/PLVRTCEngineFactory.d.ts +9 -0
- package/src/main/ets/engine/PLVRTCEngine.d.ts +75 -0
- package/src/main/ets/engine/PLVRTCEngineEventCallback.d.ts +46 -0
- package/src/main/ets/noop/PLVRTCEngineNoOp.d.ts +24 -0
- package/src/main/ets/vo/PLVRTCClientRole.d.ts +10 -0
- package/src/main/ets/vo/PLVRTCConfig.d.ts +16 -0
- package/src/main/ets/vo/PLVRTCMediaState.d.ts +7 -0
- package/src/main/ets/vo/PLVRTCNetworkQuality.d.ts +30 -0
- package/src/main/ets/vo/PLVRTCRenderViewParam.d.ts +6 -0
- package/src/main/ets/vo/PLVRTCVideoEncodeParam.d.ts +19 -0
- package/src/main/ets/vo/PLVRTCVideoRenderParam.d.ts +10 -0
- package/src/main/module.json +27 -0
- package/src/main/resources/base/element/string.json +8 -0
- package/src/main/resources/en_US/element/string.json +8 -0
- package/src/main/resources/zh_CN/element/string.json +8 -0
package/CHANGELOG.md
ADDED
package/Index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './src/main/ets/engine/PLVRTCEngine';
|
|
2
|
+
export * from './src/main/ets/engine/PLVRTCEngineEventCallback';
|
|
3
|
+
export * from './src/main/ets/vo/PLVRTCClientRole';
|
|
4
|
+
export * from './src/main/ets/vo/PLVRTCConfig';
|
|
5
|
+
export * from './src/main/ets/vo/PLVRTCMediaState';
|
|
6
|
+
export * from './src/main/ets/vo/PLVRTCRenderViewParam';
|
|
7
|
+
export * from './src/main/ets/vo/PLVRTCVideoEncodeParam';
|
|
8
|
+
export * from './src/main/ets/vo/PLVRTCVideoRenderParam';
|
|
9
|
+
export * from './src/main/ets/PLVRTCEngineFactory';
|
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
Copyright (c) 2024, contributors of the POLYV project
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
|
12
|
+
all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
20
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
string page_show 0x03000000
|
package/ets/modules.abc
ADDED
|
Binary file
|
package/obfuscation.txt
ADDED
package/oh-package.json5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@polyvharmony/rtc-sdk","version":"1.0.0-beta.1","description":"rtc-sdk","author":"POLYV","repository":"https://github.com/polyv/polyv-harmony-livescenes-sdk-demo","license":"MIT","dependencies":{"@polyvharmony/media-player-foundation":"2.3.1-beta.1"},"types":"Index.d.ts","artifactType":"obfuscation","metadata":{"byteCodeHar":true,"sourceRoots":["./src/main"],"debug":false,"declarationEntry":[],"useNormalizedOHMUrl":true},"compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","obfuscated":true}
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@polyvharmony/rtc-sdk","version":"1.0.0-beta.1","description":"rtc-sdk","author":"POLYV","repository":"https://github.com/polyv/polyv-harmony-livescenes-sdk-demo","license":"MIT","dependencies":{"@polyvharmony/media-player-foundation":"2.3.1-beta.1"},"types":"Index.d.ts","artifactType":"obfuscation","metadata":{"byteCodeHar":true,"sourceRoots":["./src/main"],"debug":false,"declarationEntry":[],"useNormalizedOHMUrl":true},"compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","obfuscated":true}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PLVRTCEngine } from "./engine/PLVRTCEngine";
|
|
2
|
+
import { PLVRTCConfig } from "./vo/PLVRTCConfig";
|
|
3
|
+
import { PLVRTCEngineEventCallback } from "./engine/PLVRTCEngineEventCallback";
|
|
4
|
+
export declare abstract class PLVRTCEngineFactory {
|
|
5
|
+
private static readonly factoryImpls;
|
|
6
|
+
static register(factory: PLVRTCEngineFactory): void;
|
|
7
|
+
static create(rtcConfig: PLVRTCConfig, eventCallback: PLVRTCEngineEventCallback): PLVRTCEngine;
|
|
8
|
+
abstract create(rtcConfig: PLVRTCConfig, eventCallback: PLVRTCEngineEventCallback): PLVRTCEngine | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { PLVRTCAppToken, PLVRTCConfig } from "../vo/PLVRTCConfig";
|
|
2
|
+
import { PLVRTCVideoEncodeParam } from "../vo/PLVRTCVideoEncodeParam";
|
|
3
|
+
import { PLVRTCVideoRenderParam } from "../vo/PLVRTCVideoRenderParam";
|
|
4
|
+
import { PLVRTCRenderViewParam } from "../vo/PLVRTCRenderViewParam";
|
|
5
|
+
import { PLVRTCEngineEventCallback } from "./PLVRTCEngineEventCallback";
|
|
6
|
+
import { PLVRTCClientRole } from "../vo/PLVRTCClientRole";
|
|
7
|
+
export declare abstract class PLVRTCEngine {
|
|
8
|
+
readonly rtcConfig: PLVRTCConfig;
|
|
9
|
+
readonly eventCallback: PLVRTCEngineEventCallback;
|
|
10
|
+
constructor(rtcConfig: PLVRTCConfig, eventCallback: PLVRTCEngineEventCallback);
|
|
11
|
+
/**
|
|
12
|
+
* 加入频道
|
|
13
|
+
*/
|
|
14
|
+
abstract joinChannel(channelId: string): number;
|
|
15
|
+
/**
|
|
16
|
+
* 离开频道
|
|
17
|
+
*/
|
|
18
|
+
abstract leaveChannel(): number;
|
|
19
|
+
/**
|
|
20
|
+
* 更新token
|
|
21
|
+
*/
|
|
22
|
+
abstract renewToken(appToken: PLVRTCAppToken): number;
|
|
23
|
+
/**
|
|
24
|
+
* 音频模块开关
|
|
25
|
+
*/
|
|
26
|
+
abstract enableAudio(enable: boolean): number;
|
|
27
|
+
/**
|
|
28
|
+
* 本地音频采集开关
|
|
29
|
+
*/
|
|
30
|
+
abstract enableLocalAudioCapture(enable: boolean): number;
|
|
31
|
+
/**
|
|
32
|
+
* 是否将本地音频发布到远端
|
|
33
|
+
*/
|
|
34
|
+
abstract enableLocalAudioPublish(enable: boolean): number;
|
|
35
|
+
/**
|
|
36
|
+
* 视频模块开关
|
|
37
|
+
*/
|
|
38
|
+
abstract enableVideo(enable: boolean): number;
|
|
39
|
+
/**
|
|
40
|
+
* 本地视频采集开关
|
|
41
|
+
*/
|
|
42
|
+
abstract enableLocalVideoCapture(enable: boolean): number;
|
|
43
|
+
/**
|
|
44
|
+
* 是否将本地视频发布到远端
|
|
45
|
+
*/
|
|
46
|
+
abstract enableLocalVideoPublish(enable: boolean): number;
|
|
47
|
+
/**
|
|
48
|
+
* 设置本地视频编码参数
|
|
49
|
+
*/
|
|
50
|
+
abstract setLocalVideoEncodeParam(videoEncodeParam: PLVRTCVideoEncodeParam): number;
|
|
51
|
+
/**
|
|
52
|
+
* 创建渲染视图 XComponent 配置参数
|
|
53
|
+
*/
|
|
54
|
+
abstract createRenderViewParam(linkmicId: string): PLVRTCRenderViewParam;
|
|
55
|
+
/**
|
|
56
|
+
* 设置视频渲染 本地&远端
|
|
57
|
+
*/
|
|
58
|
+
abstract setVideoRender(renderParam: PLVRTCVideoRenderParam): number;
|
|
59
|
+
/**
|
|
60
|
+
* 设置是否订阅远端音频
|
|
61
|
+
*/
|
|
62
|
+
abstract setRemoteAudioRender(linkmicId: string, isRender: boolean): number;
|
|
63
|
+
/**
|
|
64
|
+
* 切换角色
|
|
65
|
+
*/
|
|
66
|
+
abstract switchRole(role: PLVRTCClientRole): number;
|
|
67
|
+
/**
|
|
68
|
+
* 切换前后摄像头
|
|
69
|
+
*/
|
|
70
|
+
abstract switchCamera(): number;
|
|
71
|
+
/**
|
|
72
|
+
* 销毁
|
|
73
|
+
*/
|
|
74
|
+
abstract destroy(): number;
|
|
75
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { PLVRTCConfig } from "../vo/PLVRTCConfig";
|
|
2
|
+
import { PLVRTCMediaState } from "../vo/PLVRTCMediaState";
|
|
3
|
+
import { PLVRTCNetworkQuality } from "../vo/PLVRTCNetworkQuality";
|
|
4
|
+
export declare abstract class PLVRTCEngineEventCallback {
|
|
5
|
+
/**
|
|
6
|
+
* 成功加入频道
|
|
7
|
+
*/
|
|
8
|
+
onJoinChannelSuccess(rtcConfig: PLVRTCConfig, channelId: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* 断网重连重新加入频道
|
|
11
|
+
*/
|
|
12
|
+
onRejoinChannelSuccess(rtcConfig: PLVRTCConfig, channelId: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* 离开频道
|
|
15
|
+
*/
|
|
16
|
+
onLeaveChannel(rtcConfig: PLVRTCConfig, channelId: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* 远端用户加入频道
|
|
19
|
+
*/
|
|
20
|
+
onRemoteUserJoin(channelId: string, mediaState: PLVRTCMediaState): void;
|
|
21
|
+
/**
|
|
22
|
+
* 远端用户音视频状态变化
|
|
23
|
+
*/
|
|
24
|
+
onRemoteUserMediaStateChanged(channelId: string, mediaState: PLVRTCMediaState): void;
|
|
25
|
+
/**
|
|
26
|
+
* 远端用户离开频道
|
|
27
|
+
*/
|
|
28
|
+
onRemoteUserLeave(channelId: string, mediaState: PLVRTCMediaState): void;
|
|
29
|
+
/**
|
|
30
|
+
* token 过期回调
|
|
31
|
+
* @see PLVRTCEngine#renewToken
|
|
32
|
+
*/
|
|
33
|
+
onTokenExpired(channelId: string | undefined, rtcConfig: PLVRTCConfig): void;
|
|
34
|
+
/**
|
|
35
|
+
* 网络质量回调
|
|
36
|
+
*/
|
|
37
|
+
onNetworkQuality(linkmicId: string, upQuality: PLVRTCNetworkQuality, downQuality: PLVRTCNetworkQuality): void;
|
|
38
|
+
/**
|
|
39
|
+
* 回调 通过RTC强制下麦
|
|
40
|
+
*/
|
|
41
|
+
onKickOut(code: number): void;
|
|
42
|
+
/**
|
|
43
|
+
* 错误回调
|
|
44
|
+
*/
|
|
45
|
+
onError(code: number, message: string): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PLVRTCEngine } from "../engine/PLVRTCEngine";
|
|
2
|
+
import { PLVRTCRenderViewParam } from "../vo/PLVRTCRenderViewParam";
|
|
3
|
+
import { PLVRTCAppToken } from "../vo/PLVRTCConfig";
|
|
4
|
+
import { PLVRTCVideoEncodeParam } from "../vo/PLVRTCVideoEncodeParam";
|
|
5
|
+
import { PLVRTCVideoRenderParam } from "../vo/PLVRTCVideoRenderParam";
|
|
6
|
+
import { PLVRTCClientRole } from "../vo/PLVRTCClientRole";
|
|
7
|
+
export declare class PLVRTCEngineNoOp extends PLVRTCEngine {
|
|
8
|
+
createRenderViewParam(linkmicId: string): PLVRTCRenderViewParam;
|
|
9
|
+
enableAudio(enable: boolean): number;
|
|
10
|
+
enableLocalAudioCapture(enable: boolean): number;
|
|
11
|
+
enableLocalAudioPublish(enable: boolean): number;
|
|
12
|
+
enableLocalVideoCapture(enable: boolean): number;
|
|
13
|
+
enableLocalVideoPublish(enable: boolean): number;
|
|
14
|
+
enableVideo(enable: boolean): number;
|
|
15
|
+
joinChannel(channelId: string): number;
|
|
16
|
+
renewToken(appToken: PLVRTCAppToken): number;
|
|
17
|
+
setLocalVideoEncodeParam(videoEncodeParam: PLVRTCVideoEncodeParam): number;
|
|
18
|
+
setRemoteAudioRender(linkmicId: string, isRender: boolean): number;
|
|
19
|
+
setVideoRender(renderParam: PLVRTCVideoRenderParam): number;
|
|
20
|
+
switchRole(role: PLVRTCClientRole): number;
|
|
21
|
+
switchCamera(): number;
|
|
22
|
+
destroy(): number;
|
|
23
|
+
leaveChannel(): number;
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class PLVRTCConfig {
|
|
2
|
+
rtcType: "artc" | null;
|
|
3
|
+
context: any;
|
|
4
|
+
rtcToken: PLVRTCAppToken | null;
|
|
5
|
+
/**
|
|
6
|
+
* 连麦ID
|
|
7
|
+
*
|
|
8
|
+
* [ARTC] 取值为32位整数
|
|
9
|
+
*/
|
|
10
|
+
linkmicId: string | null;
|
|
11
|
+
}
|
|
12
|
+
export type PLVRTCAppToken = PLVARTCAppToken;
|
|
13
|
+
export type PLVARTCAppToken = {
|
|
14
|
+
appId: string;
|
|
15
|
+
token: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class PLVRTCMediaState {
|
|
2
|
+
readonly linkmicId: string;
|
|
3
|
+
readonly audioEnable: boolean;
|
|
4
|
+
readonly videoEnable: boolean;
|
|
5
|
+
readonly audioVolume: number;
|
|
6
|
+
constructor(linkmicId: string, audioEnable: boolean, videoEnable: boolean, audioVolume: number);
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum PLVRTCNetworkQuality {
|
|
2
|
+
/**
|
|
3
|
+
* 质量极好
|
|
4
|
+
*/
|
|
5
|
+
EXCELLENT = 0,
|
|
6
|
+
/**
|
|
7
|
+
* 用户主观感觉和极好差不多,但码率可能略低于极好
|
|
8
|
+
*/
|
|
9
|
+
GOOD = 1,
|
|
10
|
+
/**
|
|
11
|
+
* 用户主观感受有瑕疵但不影响沟通
|
|
12
|
+
*/
|
|
13
|
+
POOR = 2,
|
|
14
|
+
/**
|
|
15
|
+
* 勉强能沟通但不顺畅
|
|
16
|
+
*/
|
|
17
|
+
BAD = 3,
|
|
18
|
+
/**
|
|
19
|
+
* 网络质量非常差,基本不能沟通
|
|
20
|
+
*/
|
|
21
|
+
VERY_BAD = 4,
|
|
22
|
+
/**
|
|
23
|
+
* 网络连接断开,完全无法沟通
|
|
24
|
+
*/
|
|
25
|
+
DISCONNECT = 5,
|
|
26
|
+
/**
|
|
27
|
+
* 未知网络
|
|
28
|
+
*/
|
|
29
|
+
UNKNOWN = 6
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class PLVRTCVideoEncodeParam {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
frameRate: number;
|
|
5
|
+
targetBitRate: number | undefined;
|
|
6
|
+
minBitRate: number | undefined;
|
|
7
|
+
pushDowngradePreference: PLVPushDowngradePreference;
|
|
8
|
+
pushOrientation: PLVPushOrientation;
|
|
9
|
+
pushMirror: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare enum PLVPushDowngradePreference {
|
|
12
|
+
PREFER_BETTER_QUALITY = 0,
|
|
13
|
+
PREFER_BETTER_FLUENCY = 1
|
|
14
|
+
}
|
|
15
|
+
export declare enum PLVPushOrientation {
|
|
16
|
+
AUTO = 0,
|
|
17
|
+
LANDSCAPE = 1,
|
|
18
|
+
PORTRAIT = 2
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app": {
|
|
3
|
+
"bundleName": "net.polyv.rtc",
|
|
4
|
+
"versionCode": 10000,
|
|
5
|
+
"versionName": "1.0.0",
|
|
6
|
+
"minAPIVersion": 50000012,
|
|
7
|
+
"targetAPIVersion": 50000012,
|
|
8
|
+
"apiReleaseType": "Release",
|
|
9
|
+
"compileSdkVersion": "5.0.0.71",
|
|
10
|
+
"compileSdkType": "HarmonyOS",
|
|
11
|
+
"appEnvironments": [],
|
|
12
|
+
"bundleType": "app"
|
|
13
|
+
},
|
|
14
|
+
"module": {
|
|
15
|
+
"name": "rtc_sdk",
|
|
16
|
+
"type": "har",
|
|
17
|
+
"deviceTypes": [
|
|
18
|
+
"default",
|
|
19
|
+
"tablet"
|
|
20
|
+
],
|
|
21
|
+
"packageName": "@polyvharmony/rtc-sdk",
|
|
22
|
+
"installationFree": false,
|
|
23
|
+
"virtualMachine": "ark12.0.2.0",
|
|
24
|
+
"compileMode": "esmodule",
|
|
25
|
+
"dependencies": []
|
|
26
|
+
}
|
|
27
|
+
}
|