@byteplus/react-native-live-push 1.0.0

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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/android/build.gradle +92 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +16 -0
  6. package/android/src/main/AndroidManifestNew.xml +16 -0
  7. package/android/src/main/java/com/volcengine/velive/rn/push/ExternalSourceHelper.java +58 -0
  8. package/android/src/main/java/com/volcengine/velive/rn/push/NativeVariableManager.java +19 -0
  9. package/android/src/main/java/com/volcengine/velive/rn/push/ScreenCaptureHelper.java +73 -0
  10. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushModule.java +182 -0
  11. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushModuleSpec.java +16 -0
  12. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushPackage.java +27 -0
  13. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushView.java +45 -0
  14. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushViewManager.java +87 -0
  15. package/ios/VeLivePushSDK.h +24 -0
  16. package/ios/VeLivePushSDK.m +109 -0
  17. package/ios/VeLivePushView.h +24 -0
  18. package/ios/VeLivePushView.m +74 -0
  19. package/ios/VeLivePushViewManager.m +59 -0
  20. package/lib/commonjs/index.js +24238 -0
  21. package/lib/module/index.js +24186 -0
  22. package/lib/typescript/android/index.d.ts +44 -0
  23. package/lib/typescript/codegen/android/api.d.ts +372 -0
  24. package/lib/typescript/codegen/android/callback.d.ts +91 -0
  25. package/lib/typescript/codegen/android/errorcode.d.ts +26 -0
  26. package/lib/typescript/codegen/android/index.d.ts +5 -0
  27. package/lib/typescript/codegen/android/keytype.d.ts +469 -0
  28. package/lib/typescript/codegen/android/types.d.ts +32 -0
  29. package/lib/typescript/codegen/ios/api.d.ts +257 -0
  30. package/lib/typescript/codegen/ios/callback.d.ts +88 -0
  31. package/lib/typescript/codegen/ios/errorcode.d.ts +54 -0
  32. package/lib/typescript/codegen/ios/index.d.ts +5 -0
  33. package/lib/typescript/codegen/ios/keytype.d.ts +488 -0
  34. package/lib/typescript/codegen/ios/types.d.ts +35 -0
  35. package/lib/typescript/codegen/pack/api.d.ts +1933 -0
  36. package/lib/typescript/codegen/pack/callback.d.ts +542 -0
  37. package/lib/typescript/codegen/pack/errorcode.d.ts +174 -0
  38. package/lib/typescript/codegen/pack/index.d.ts +5 -0
  39. package/lib/typescript/codegen/pack/keytype.d.ts +1952 -0
  40. package/lib/typescript/codegen/pack/types.d.ts +1 -0
  41. package/lib/typescript/codegen/type-shim.d.ts +6 -0
  42. package/lib/typescript/component.d.ts +8 -0
  43. package/lib/typescript/core/api.d.ts +2 -0
  44. package/lib/typescript/core/callback.d.ts +2 -0
  45. package/lib/typescript/core/env.d.ts +29 -0
  46. package/lib/typescript/core/errorcode.d.ts +2 -0
  47. package/lib/typescript/core/index.d.ts +6 -0
  48. package/lib/typescript/core/keytype.d.ts +7 -0
  49. package/lib/typescript/core/pusher.d.ts +16 -0
  50. package/lib/typescript/index.d.ts +2 -0
  51. package/lib/typescript/ios/extends.d.ts +41 -0
  52. package/lib/typescript/runtime.d.ts +1 -0
  53. package/package.json +31 -0
  54. package/react-native-velive-push.podspec +45 -0
@@ -0,0 +1,488 @@
1
+ import { int, BOOL, NSDictionary, float, CMTime, GLuint, CVPixelBufferRef, CMSampleBufferRef, NSData, NSArray, NSString, NSUInteger, long } from './types';
2
+ export declare enum VeLiveVideoEffectLicenseType {
3
+
4
+ VeLiveVideoEffectLicenseTypeOffLine = 0,
5
+
6
+ VeLiveVideoEffectLicenseTypeOnLine = 1
7
+ }
8
+ export declare enum VeLiveNetworkQuality {
9
+
10
+ VeLiveNetworkQualityUnknown = -1,
11
+
12
+ VeLiveNetworkQualityBad = 0,
13
+
14
+ VeLiveNetworkQualityPoor = 1,
15
+
16
+ VeLiveNetworkQualityGood = 2
17
+ }
18
+ export declare enum VeLiveAudioChannel {
19
+
20
+ VeLiveAudioChannelMono = 1,
21
+
22
+ VeLiveAudioChannelStereo = 2
23
+ }
24
+ export declare enum VeLiveVideoEncodeFrameType {
25
+
26
+ VeLiveVideoEncodeFrameTypeIDR = 1,
27
+
28
+ VeLiveVideoEncodeFrameTypeSPSPPS = 2,
29
+
30
+ VeLiveVideoEncodeFrameTypeB = 3,
31
+
32
+ VeLiveVideoEncodeFrameTypeP = 4
33
+ }
34
+ export declare class VeLiveVideoEncoderConfiguration {
35
+
36
+ resolution: VeLiveVideoResolution;
37
+
38
+ codec: VeLiveVideoCodec;
39
+
40
+ bitrate: int;
41
+
42
+ minBitrate: int;
43
+
44
+ maxBitrate: int;
45
+
46
+ gopSize: int;
47
+
48
+ fps: int;
49
+
50
+ enableBFrame: BOOL;
51
+
52
+ enableAccelerate: BOOL;
53
+
54
+ initWithResolution(resolution: VeLiveVideoResolution): this;
55
+ }
56
+ export declare enum VeLiveVideoFrameSource {
57
+
58
+ VeLiveVideoFrameSourceCapture = "1<<0",
59
+
60
+ VeLiveVideoFrameSourcePreEncode = "1<<1"
61
+ }
62
+ export declare enum VeLiveAudioBufferType {
63
+
64
+ VeLiveAudioBufferTypeUnknown = -1,
65
+
66
+ VeLiveAudioBufferTypeSampleBuffer = 0,
67
+
68
+ VeLiveAudioBufferTypeNSData = 1
69
+ }
70
+ export declare class VeLivePusherConfiguration {
71
+
72
+ videoCaptureConfig: VeLiveVideoCaptureConfiguration;
73
+
74
+ audioCaptureConfig: VeLiveAudioCaptureConfiguration;
75
+
76
+ reconnectIntervalSeconds: int;
77
+
78
+ reconnectCount: int;
79
+
80
+ extraParameters: NSDictionary;
81
+ init(): this;
82
+ }
83
+ export declare enum VeLiveVideoCaptureType {
84
+
85
+ VeLiveVideoCaptureFrontCamera = 0,
86
+
87
+ VeLiveVideoCaptureBackCamera = 1,
88
+
89
+ VeLiveVideoCaptureDualCamera = 2,
90
+
91
+ VeLiveVideoCaptureExternal = 4,
92
+
93
+ VeLiveVideoCaptureCustomImage = 5,
94
+
95
+ VeLiveVideoCaptureLastFrame = 6,
96
+
97
+ VeLiveVideoCaptureDummyFrame = 7
98
+ }
99
+ export declare class VeLiveFileRecorderConfiguration {
100
+
101
+ width: int;
102
+
103
+ height: int;
104
+
105
+ fps: int;
106
+
107
+ bitrate: int;
108
+ init(): this;
109
+ }
110
+ export declare enum VeLiveVideoBufferType {
111
+
112
+ VeLiveVideoBufferTypeUnKnown = -1,
113
+
114
+ VeLiveVideoBufferTypePixelBuffer = 0,
115
+
116
+ VeLiveVideoBufferTypeSampleBuffer = 1,
117
+
118
+ VeLiveVideoBufferTypeNSData = 2,
119
+
120
+ VeLiveVideoBufferTypeTexture = 3
121
+ }
122
+ export declare class VeLiveMixVideoLayout {
123
+
124
+ streamId: int;
125
+
126
+ x: float;
127
+
128
+ y: float;
129
+
130
+ width: float;
131
+
132
+ height: float;
133
+
134
+ alpha: float;
135
+
136
+ zOrder: int;
137
+
138
+ renderMode: VeLivePusherRenderMode;
139
+ init(): this;
140
+ }
141
+ export declare class VeLiveMixAudioLayout {
142
+
143
+ streamId: int;
144
+
145
+ volume: float;
146
+ init(): this;
147
+ }
148
+ export declare enum VeLiveAudioProfile {
149
+
150
+ VeLiveAudioAACProfileLC = 0,
151
+
152
+ VeLiveAudioAACProfileHEv1 = 1,
153
+
154
+ VeLiveAudioAACProfileHEv2 = 2
155
+ }
156
+ export declare class VeLiveVideoFrame {
157
+
158
+ bufferType: VeLiveVideoBufferType;
159
+
160
+ pixelFormat: VeLivePixelFormat;
161
+
162
+ rotation: VeLiveVideoRotation;
163
+
164
+ width: int;
165
+
166
+ height: int;
167
+
168
+ pts: CMTime;
169
+
170
+ textureId: GLuint;
171
+
172
+ pixelBuffer: CVPixelBufferRef;
173
+
174
+ sampleBuffer: CMSampleBufferRef;
175
+
176
+ data: NSData;
177
+ init(): this;
178
+
179
+ releaseCallback(): void;
180
+ }
181
+ export declare enum VeLiveVideoFluencyLevel {
182
+
183
+ VeLiveVideoFluencyLevelSmooth = 0,
184
+
185
+ VeLiveVideoFluencyLevelSluggish = 1,
186
+
187
+ VeLiveVideoFluencyLevelBlocked = 2,
188
+
189
+ VeLiveVideoFluencyLevelStuck = 3
190
+ }
191
+ export declare enum VeLiveVideoMirrorType {
192
+
193
+ VeLiveVideoMirrorCapture = 0,
194
+
195
+ VeLiveVideoMirrorPreview = 1,
196
+
197
+ VeLiveVideoMirrorPushStream = 2
198
+ }
199
+ export declare class VeLiveAudioCaptureConfiguration {
200
+
201
+ sampleRate: VeLiveAudioSampleRate;
202
+
203
+ channel: VeLiveAudioChannel;
204
+ init(): this;
205
+ }
206
+ export declare enum VeLiveVideoResolution {
207
+
208
+ VeLiveVideoResolution360P = 0,
209
+
210
+ VeLiveVideoResolution480P = 1,
211
+
212
+ VeLiveVideoResolution540P = 2,
213
+
214
+ VeLiveVideoResolution720P = 3,
215
+
216
+ VeLiveVideoResolution1080P = 4,
217
+
218
+ VeLiveVideoResolutionScreen = 10
219
+ }
220
+ export declare enum VeLiveVideoRotation {
221
+
222
+ VeLiveVideoRotation0 = 0,
223
+
224
+ VeLiveVideoRotation90 = 1,
225
+
226
+ VeLiveVideoRotation180 = 2,
227
+
228
+ VeLiveVideoRotation270 = 3
229
+ }
230
+ export declare class VeLiveStreamMixDescription {
231
+
232
+ mixVideoStreams: NSArray<VeLiveMixVideoLayout>;
233
+
234
+ mixAudioStreams: NSArray<VeLiveMixAudioLayout>;
235
+
236
+ backgroundColor: NSString;
237
+ init(): this;
238
+ }
239
+ export declare enum VeLiveAudioCaptureType {
240
+
241
+ VeLiveAudioCaptureMicrophone = 0,
242
+
243
+ VeLiveAudioCaptureVoiceCommunication = 1,
244
+
245
+ VeLiveAudioCaptureExternal = 2,
246
+
247
+ VeLiveAudioCaptureMuteFrame = 3
248
+ }
249
+ export declare enum VeLiveVideoCodec {
250
+
251
+ VeLiveVideoCodecH264 = 0,
252
+
253
+ VeLiveVideoCodecByteVC1 = 1
254
+ }
255
+ export declare class VeLiveVideoEncodeFrame {
256
+
257
+ pts: CMTime;
258
+
259
+ dts: CMTime;
260
+
261
+ videoEcodeFrameType: VeLiveVideoEncodeFrameType;
262
+
263
+ data: NSData;
264
+ init(): this;
265
+ }
266
+ export declare class VeLiveAudioEncoderConfiguration {
267
+
268
+ bitrate: int;
269
+
270
+ sampleRate: VeLiveAudioSampleRate;
271
+
272
+ channel: VeLiveAudioChannel;
273
+
274
+ profile: VeLiveAudioProfile;
275
+ init(): this;
276
+ }
277
+ export declare enum VeLivePusherLogLevel {
278
+
279
+ VeLivePusherLogLevelVerbose = 0,
280
+
281
+ VeLivePusherLogLevelDebug = 1,
282
+
283
+ VeLivePusherLogLevelInfo = 2,
284
+
285
+ VeLivePusherLogLevelWarn = 3,
286
+
287
+ VeLivePusherLogLevelError = 4,
288
+
289
+ VeLivePusherLogLevelNone = 5
290
+ }
291
+ export declare enum VeLiveAudioMixType {
292
+
293
+ VeLiveAudioMixPush = 0,
294
+
295
+ VeLiveAudioMixPlayAndPush = 1
296
+ }
297
+ export declare enum VeLivePusherRenderMode {
298
+
299
+ VeLivePusherRenderModeHidden = 0,
300
+
301
+ VeLivePusherRenderModeFit = 1,
302
+
303
+ VeLivePusherRenderModeFill = 2
304
+ }
305
+ export declare class VeLiveVideoEffectLicenseConfiguration {
306
+
307
+ type: VeLiveVideoEffectLicenseType;
308
+
309
+ path: NSString;
310
+
311
+ key: NSString;
312
+
313
+ secret: NSString;
314
+
315
+ url: NSString;
316
+
317
+ initWithPath(path: NSString): this;
318
+
319
+ initWithKey(key: NSString, secret: NSString, url: NSString): this;
320
+ }
321
+ export declare enum VeLiveAudioFrameSource {
322
+
323
+ VeLiveAudioFrameSourceCapture = "1<<0",
324
+
325
+ VeLiveAudioFrameSourcePreEncode = "1<<1"
326
+ }
327
+ export declare enum VeLivePushStatus {
328
+
329
+ VeLivePushStatusNone = 0,
330
+
331
+ VeLivePushStatusConnecting = 1,
332
+
333
+ VeLivePushStatusConnectSuccess = 2,
334
+
335
+ VeLivePushStatusReconnecting = 3,
336
+
337
+ VeLivePushStatusConnectStop = 4,
338
+
339
+ VeLivePushStatusConnectError = 5,
340
+
341
+ VeLivePushStatusDisconnected = 6
342
+ }
343
+ export declare class VeLivePusherLogConfig {
344
+ deviceID: NSString;
345
+
346
+ logPath: NSString;
347
+
348
+ maxLogSizeM: NSUInteger;
349
+
350
+ singleLogSizeM: NSUInteger;
351
+
352
+ logExpireTimeS: NSUInteger;
353
+
354
+ enableConsole: BOOL;
355
+
356
+ enableLogFile: BOOL;
357
+
358
+ logLevel: VeLivePusherLogLevel;
359
+
360
+ queryUrl: NSString;
361
+
362
+ enableThreadLoop: int;
363
+
364
+ intervalMs: long;
365
+
366
+ httpTimeout: int;
367
+
368
+ uploadFileHttpTimeout: int;
369
+ init(): this;
370
+ }
371
+ export declare enum VeLiveFirstFrameType {
372
+
373
+ VeLiveFirstCaptureFrame = 0,
374
+
375
+ VeLiveFirstRenderFrame = 1,
376
+
377
+ VeLiveFirstEncodedFrame = 2,
378
+
379
+ VeLiveFirstSendFrame = 3,
380
+
381
+ VeLiveFirstAppAudioCaptureFrame = 4
382
+ }
383
+ export declare enum VeLiveAudioSampleRate {
384
+
385
+ VeLiveAudioSampleRate44100 = 44100
386
+ }
387
+ export declare class VeLivePusherStatistics {
388
+
389
+ captureWidth: int;
390
+
391
+ captureHeight: int;
392
+
393
+ captureFps: int;
394
+
395
+ encodeWidth: int;
396
+
397
+ encodeHeight: int;
398
+
399
+ encodeFps: int;
400
+
401
+ encodeVideoBitrate: int;
402
+
403
+ encodeAudioBitrate: int;
404
+
405
+ transportFps: int;
406
+
407
+ transportVideoBitrate: int;
408
+
409
+ fps: int;
410
+
411
+ videoBitrate: int;
412
+
413
+ minVideoBitrate: int;
414
+
415
+ maxVideoBitrate: int;
416
+
417
+ url: NSString;
418
+
419
+ codec: NSString;
420
+ init(): this;
421
+ }
422
+ export declare enum VeLivePixelFormat {
423
+
424
+ VeLivePixelFormatUnknown = -1,
425
+
426
+ VeLivePixelFormatI420 = 0,
427
+
428
+ VeLivePixelFormatNV12 = 1,
429
+
430
+ VeLivePixelFormatNV21 = 2,
431
+
432
+ VeLivePixelFormatBGRA32 = 3,
433
+
434
+ VeLivePixelFormat2DTexture = 4
435
+ }
436
+ export declare class VeLiveVideoCaptureConfiguration {
437
+
438
+ width: int;
439
+
440
+ height: int;
441
+
442
+ fps: int;
443
+
444
+ pixelFormat: OSType;
445
+ init(): this;
446
+ }
447
+ export declare class VeLiveAudioFrame {
448
+
449
+ bufferType: VeLiveAudioBufferType;
450
+
451
+ sampleRate: VeLiveAudioSampleRate;
452
+
453
+ channels: VeLiveAudioChannel;
454
+
455
+ pts: CMTime;
456
+
457
+ sampleBuffer: CMSampleBufferRef;
458
+
459
+ data: NSData;
460
+ init(): this;
461
+ }
462
+ export declare enum VeLiveAudioPowerLevel {
463
+
464
+ VeLiveAudioPowerLevelSilent = 0,
465
+
466
+ VeLiveAudioPowerLevelQuiet = 1,
467
+
468
+ VeLiveAudioPowerLevelLight = 2,
469
+
470
+ VeLiveAudioPowerLevelNormal = 3,
471
+
472
+ VeLiveAudioPowerLevelLoud = 4,
473
+
474
+ VeLiveAudioPowerLevelNoisy = 5
475
+ }
476
+ export declare enum UIInterfaceOrientation {
477
+ UIInterfaceOrientationUnknown = 0,
478
+ UIInterfaceOrientationPortrait = 1,
479
+ UIInterfaceOrientationPortraitUpsideDown = 2,
480
+ UIInterfaceOrientationLandscapeLeft = 3,
481
+ UIInterfaceOrientationLandscapeRight = 4
482
+ }
483
+ export declare enum OSType {
484
+ kCVPixelFormatType_32BGRA = "BGRA",
485
+ kCVPixelFormatType_420YpCbCr8BiPlanarFullRange = "420f",
486
+ kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange = "420v",
487
+ kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = "x420"
488
+ }
@@ -0,0 +1,35 @@
1
+ export type id<T = any> = T;
2
+ export type BOOL = boolean;
3
+ export type int = number;
4
+ export type long = number;
5
+ export type float = number;
6
+ export type int64_t = number;
7
+ export type NSString = string;
8
+ export type NSMutableString = string;
9
+ export type NSInteger = number;
10
+ export type NSUInteger = number;
11
+ export type NSNumber = number;
12
+ export type NSValue = number;
13
+ export type NSNull = null;
14
+ export type NSArray<T> = Array<T>;
15
+ export type NSMutableArray<T> = Array<T>;
16
+ export type NSObject = Object;
17
+ export type NSDictionary = Object;
18
+ export type NSMutableDictionary = Object;
19
+ export type NSDate = Date;
20
+ export type NSData = ArrayBuffer;
21
+ export type NSURL = string;
22
+ export type NSError = {
23
+ code: number;
24
+ domain: string;
25
+ };
26
+ export type NSTimeInterval = number;
27
+ export type UIView = any;
28
+ export type UIImage = unknown;
29
+ export type CVPixelBufferRef = any;
30
+ export type CMSampleBufferRef = any;
31
+ export type CMTime = number;
32
+ export type GLuint = number;
33
+ export type CGFloat = number;
34
+ export type CGPoint = any;
35
+ export type EAGLContext = any;