matrixbirds vor 5 Jahren
Ursprung
Commit
5fa4036b0e

+ 0
- 1
.gitignore Datei anzeigen

@@ -75,4 +75,3 @@ samples/**/package-lock.json
75 75
 android/bin
76 76
 yarn.lock
77 77
 package-lock.json
78
-lib

+ 1
- 1
.npmignore Datei anzeigen

@@ -37,4 +37,4 @@ proguard-rules.pro
37 37
 .vscode
38 38
 package-lock.json
39 39
 android/bin
40
-lib/**/*.ts.map
40
+lib/**/*.map

+ 1
- 1
lib/AgoraView.native.d.ts Datei anzeigen

@@ -1,5 +1,5 @@
1 1
 import React from 'react';
2
-import { AgoraViewProps } from "./types.d";
2
+import { AgoraViewProps } from "./types";
3 3
 /**
4 4
  * AgoraView is the render layer for rendering video stream
5 5
  *

+ 42
- 0
lib/AgoraView.native.js Datei anzeigen

@@ -0,0 +1,42 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const tslib_1 = require("tslib");
4
+const react_1 = tslib_1.__importDefault(require("react"));
5
+const react_native_1 = require("react-native");
6
+/**
7
+ * Import RCTAgoraView from native binding.
8
+ *
9
+ * This @object is used to bridge native layer between react layer.
10
+ */
11
+const RCTAgoraView = react_native_1.requireNativeComponent("RCTAgoraView");
12
+/**
13
+ * AgoraView is the render layer for rendering video stream
14
+ *
15
+ * This class is used to rendering native sdk stream
16
+ *
17
+ * @props {@link AgoraViewProps}
18
+ */
19
+class AgoraView extends react_1.default.Component {
20
+    /**
21
+     * render
22
+     *
23
+     * It would render view for VideoStream
24
+     */
25
+    render() {
26
+        return (react_1.default.createElement(RCTAgoraView, Object.assign({}, this.getHTMLProps())));
27
+    }
28
+    /**
29
+     * getHTMLProps
30
+     *
31
+     * get agora view props
32
+     */
33
+    getHTMLProps() {
34
+        let htmlProps = {};
35
+        for (let key in this.props) {
36
+            htmlProps[key] = this.props[key];
37
+        }
38
+        return htmlProps;
39
+    }
40
+}
41
+exports.default = AgoraView;
42
+//# sourceMappingURL=AgoraView.native.js.map

+ 1
- 0
lib/AgoraView.native.js.map Datei anzeigen

@@ -0,0 +1 @@
1
+{"version":3,"file":"AgoraView.native.js","sourceRoot":"","sources":["../src/AgoraView.native.tsx"],"names":[],"mappings":";;;AAAA,0DAA0B;AAC1B,+CAEqB;AAMrB;;;;GAIG;AAEH,MAAM,YAAY,GAAG,qCAAsB,CAAC,cAAc,CAAC,CAAC;AAE5D;;;;;;GAMG;AACH,MAAqB,SAAU,SAAQ,eAAK,CAAC,SAAyB;IAClE;;;;OAIG;IACI,MAAM;QACT,OAAO,CACH,8BAAC,YAAY,oBAAM,IAAI,CAAC,YAAY,EAAE,EAAK,CAC9C,CAAA;IACL,CAAC;IAED;;;;OAIG;IACK,YAAY;QAChB,IAAI,SAAS,GAAG,EAAoB,CAAC;QACrC,KAAK,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE;YACxB,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAxBD,4BAwBC"}

+ 1
- 1
lib/RtcEngine.native.d.ts Datei anzeigen

@@ -1,4 +1,4 @@
1
-import { Option, Callback, VideoOption, AudioMixingOption, DataStreamOption, PlayEffectOption, AudioRecordingOption, AudioFrameOption, MixedAudioFrameOption, ImageOption, VideoStreamOption, DefaultVideoStreamOption, InjectStreamOption, RemoveInjectStreamOption, PublishStreamOption, RemovePublishStreamOption, LiveTranscodingOption, PositionOption, BeautyOption, LastmileProbeConfig, CameraCapturerConfiguration } from "./types.d";
1
+import { Option, Callback, VideoOption, AudioMixingOption, DataStreamOption, PlayEffectOption, AudioRecordingOption, AudioFrameOption, MixedAudioFrameOption, ImageOption, VideoStreamOption, DefaultVideoStreamOption, InjectStreamOption, RemoveInjectStreamOption, PublishStreamOption, RemovePublishStreamOption, LiveTranscodingOption, PositionOption, BeautyOption, LastmileProbeConfig, CameraCapturerConfiguration } from "./types";
2 2
 /**
3 3
  * RtcEngine is the javascript object for control agora native sdk through react native bridge.
4 4
  *

+ 1216
- 0
lib/RtcEngine.native.js
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 1
- 0
lib/RtcEngine.native.js.map
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 7
- 0
lib/index.js Datei anzeigen

@@ -0,0 +1,7 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+var AgoraView_native_1 = require("./AgoraView.native");
4
+exports.AgoraView = AgoraView_native_1.default;
5
+var RtcEngine_native_1 = require("./RtcEngine.native");
6
+exports.RtcEngine = RtcEngine_native_1.default;
7
+//# sourceMappingURL=index.js.map

+ 1
- 0
lib/index.js.map Datei anzeigen

@@ -0,0 +1 @@
1
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,uDAAwD;AAAhD,uCAAA,OAAO,CAAa;AAC5B,uDAAwD;AAAhD,uCAAA,OAAO,CAAa"}

+ 235
- 0
lib/types.d.ts Datei anzeigen

@@ -0,0 +1,235 @@
1
+import { ViewProps } from 'react-native';
2
+/**
3
+ * VideoEncoderConfig details
4
+ * @property width: number | The encoder video's width
5
+ * @property height: number | The encoder video's height
6
+ * @property bitrate: number | The encoder video's bitrate
7
+ * @property frameRate: number | The frameRate of encoder video
8
+ * @property orientationMode: number | The video orientation mode of the video
9
+ * @orientationMode value range is [0 is "mode adapative", 1 is "mode fixed landscape", 2 is "mode fixed portrait"]
10
+ */
11
+export interface VideoEncoderConfig {
12
+    width: number;
13
+    height: number;
14
+    bitrate: number;
15
+    frameRate: number;
16
+    orientationMode: number;
17
+}
18
+/**
19
+ * Option is work for init method
20
+ * @property: string appid Sets the appid
21
+ * @property: number channelProfile Sets the channel mode. 0 is communication mode, 1 is broadcasting mode
22
+ * @property: {@link VideoEncoderConfig} sets video encoding config
23
+ * @property: mode is optional sets only enable video / audio, 0 is audio mode, 1 is video mode
24
+ * @property: clientRole is only work in live mode, 1 is host, 2 is audience
25
+ * @property: dualStream is optional parameter only for enable for detail see {@link https://docs.agora.io/en/Video/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/enableDualStreamMode:}
26
+ * @property: audioProfile {@link https://docs.agora.io/en/Video/API%20Reference/oc/Constants/AgoraAudioProfile.html}
27
+ * @property: audioScenario {@link https://docs.agora.io/en/Video/API%20Reference/oc/Constants/AgoraAudioScenario.html}
28
+ */
29
+export interface Option {
30
+    appid: String;
31
+    channelProfile: number;
32
+    videoEncoderConfig: VideoEncoderConfig;
33
+    dualStream: boolean;
34
+    mode: number;
35
+    clientRole: number;
36
+    audioProfile: number;
37
+    audioScenario: number;
38
+    beauty?: BeautyOption;
39
+    voice?: VoiceDecorator;
40
+}
41
+/**
42
+ * VoiceDecorator is decorate local audio voice
43
+ *
44
+ * @property type: string | the range values ['changer' | 'reverbPreset'] This property is the identifier for audio voice decorator
45
+ * @property value: number | the value for voice parameter option.
46
+ * type 'reverbPreset' range values: [0 is "off", 1 is "popular", 2 is "rnb", 3 is "rock", 4 is "hiphop", 5 is "vocal concert", 6 is "KTV", 7 is "studio"]
47
+ * type 'changer' range values: [0 is "off", 1 is "old man", 2 is "baby boy", 3 is "baby girl", 4 is "zhubajie", 5 is "ethereal", 6 is "hulk"]
48
+ */
49
+export interface VoiceDecorator {
50
+    type: string;
51
+    value: number;
52
+}
53
+export interface PublisherConfig {
54
+    width: number;
55
+    height: number;
56
+    framerate: number;
57
+    bitrate: number;
58
+    defaultLayout: number;
59
+    lifeCycle: number;
60
+    pubishUrl: string;
61
+    rawStreamUrl: string;
62
+    extraInfo: String;
63
+    owner: boolean;
64
+}
65
+export interface BackgroundImage {
66
+    url: string;
67
+    x: number;
68
+    y: number;
69
+    width: number;
70
+    height: number;
71
+}
72
+export interface Rect {
73
+    x: number;
74
+    y: number;
75
+    width: number;
76
+    height: number;
77
+}
78
+export interface Size {
79
+    width: number;
80
+    height: number;
81
+}
82
+export interface TranscodingUser {
83
+    uid: number;
84
+    zOrder: number;
85
+    rect: Rect;
86
+    alpha: number;
87
+    audioChannel: number;
88
+}
89
+export interface Color {
90
+    red: number;
91
+    green: number;
92
+    blue: number;
93
+    alpha: number;
94
+}
95
+export interface LiveTranscodingOption {
96
+    size: Size;
97
+    videoBitrate: number;
98
+    videoFramerate: number;
99
+    lowLatency: boolean;
100
+    videoGop: number;
101
+    videoCodecProfile: number;
102
+    transcodingUsers: Array<TranscodingUser>;
103
+    transcodingExtraInfo: string;
104
+    watermark: BackgroundImage;
105
+    backgroundImage: BackgroundImage;
106
+    backgroundColor: Color;
107
+    audioSampleRate: number;
108
+    audioBitrate: number;
109
+    audioChannels: number;
110
+}
111
+export interface VideoOption {
112
+    uid: number;
113
+    renderMode: number;
114
+    reactTag: number;
115
+}
116
+export interface AudioRecordingOption {
117
+    filepath: String;
118
+    quality: number;
119
+}
120
+export declare type Callback<T> = (err: any, data: any) => T;
121
+export declare type Nullable<T> = T | null | undefined;
122
+export declare type String = Nullable<string>;
123
+export declare type Number = Nullable<number> | 0;
124
+export interface AgoraViewProps extends ViewProps {
125
+    showLocalVideo: boolean;
126
+    remoteUid: number;
127
+    zOrderMediaOverlay: boolean;
128
+    [key: string]: any;
129
+}
130
+export interface DataStreamOption {
131
+    streamId: number;
132
+    ordered: boolean;
133
+    reliable: boolean;
134
+}
135
+export interface AudioMixingOption {
136
+    filepath: String;
137
+    loopback: boolean;
138
+    replace: boolean;
139
+    cycle: number;
140
+}
141
+export interface PlayEffectOption {
142
+    soundId: number;
143
+    filepath: String;
144
+    loopcount: number;
145
+    pitch: number;
146
+    pan: number;
147
+    gain: number;
148
+    publish: boolean;
149
+}
150
+export interface AudioFrameOption {
151
+    sampleRate: number;
152
+    channel: number;
153
+    mode: number;
154
+    samplesPerCall: number;
155
+}
156
+export interface MixedAudioFrameOption {
157
+    sampleRate: number;
158
+    samplesPerCall: number;
159
+}
160
+export interface ImageOption {
161
+    url: String;
162
+    height: number;
163
+    width: number;
164
+    x: number;
165
+    y: number;
166
+}
167
+export interface VideoStreamOption {
168
+    uid: number;
169
+    streamType: number;
170
+}
171
+export interface DefaultVideoStreamOption {
172
+    streamType: number;
173
+}
174
+export interface InjectStreamOption {
175
+    url: String;
176
+    config: {
177
+        size: {
178
+            width: number;
179
+            height: number;
180
+        };
181
+        videoGop: number;
182
+        videoBitrate: number;
183
+        videoFramerate: number;
184
+        audioBitrate: number;
185
+        audioSampleRate: number;
186
+        audioChannels: number;
187
+    };
188
+}
189
+export interface RemoveInjectStreamOption {
190
+    url: String;
191
+}
192
+export interface PublishStreamOption {
193
+    url: String;
194
+    enable: boolean;
195
+}
196
+export interface RemovePublishStreamOption {
197
+    url: String;
198
+}
199
+export interface PositionOption {
200
+    x: number;
201
+    y: number;
202
+}
203
+/**
204
+ * BeautyOption is setBeautyEffectOptions's option parameter
205
+ * @property lighteningContrastLevel: integer | lightening contrast level and the value ranges is low: 0, normal: 1, high: 2
206
+ * @property lighteningLevel: float | brightness level and the value ranges between 0.0 (original) and 1.0.
207
+ * @property smoothnessLevel: float | The sharpness level. The value ranges between 0.0 (original) and 1.0. This parameter is usually used to remove blemishes.
208
+ * @property rednessLevel: float | The redness level. The value ranges between 0.0 (original) and 1.0. This parameter adjusts the red saturation level.
209
+ */
210
+export interface BeautyOption {
211
+    lighteningContrastLevel: number;
212
+    lighteningLevel: number;
213
+    smoothnessLevel: number;
214
+    rednessLevel: number;
215
+}
216
+/**
217
+ * LastmileProbeConfig is startLastmileProbeTest's config parameter
218
+ * @property probeUplink: boolean | sets whether or not to test the uplink networks. some users, for example, the audience in a Live-broadcast channel, do not need such a test. true: enables the probe test. false: disables the probe test.
219
+ * @property probeDownlink: boolean | sets whether or not to probe the downlink network. true: enables the probe test. false: disables the probe test.
220
+ * @property expectedUplinkBitrate: integer | The expected maximum sending bitrate (Kbps) of the local user. The value ranges between 100 and 5000. We recommend setting this parameter according to the bitrate value set by setVideoEncoderConfiguration.
221
+ * @property expectedDownlinkBitrate: integer | The expected maximum receiving bitrate (Kbps) of the local user. The value ranges between 100 and 5000.
222
+ */
223
+export interface LastmileProbeConfig {
224
+    probeUplink: boolean;
225
+    probeDownlink: boolean;
226
+    expectedUplinkBitrate: number;
227
+    expectedDownlinkBitrate: number;
228
+}
229
+/**
230
+ * CameraCapturerConfiguration is setCameraCapturerConfiguration's config parameter
231
+ * @property preference: number | The Camera capture preference and the value range is [0 is "(default) self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality.", 1 is "prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by setVideoEncoderConfiguration.", 2 is "prioritizes the local preview quality. The SDK chooses higher camera output parameters to improve the local video preview quality. This option requires extra CPU and RAM usage for video pre-processing."]
232
+ */
233
+export interface CameraCapturerConfiguration {
234
+    preference: number;
235
+}

+ 3
- 0
lib/types.js Datei anzeigen

@@ -0,0 +1,3 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+//# sourceMappingURL=types.js.map

+ 1
- 0
lib/types.js.map Datei anzeigen

@@ -0,0 +1 @@
1
+{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}