@byteplus/react-native-rtc 1.0.6 → 1.1.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 (38) hide show
  1. package/README.md +0 -316
  2. package/android/build.gradle +58 -43
  3. package/android/src/live/java/com/volcengine/reactnative/vertc/live/VertcLive.java +143 -0
  4. package/android/src/main/java/com/volcengine/reactnative/vertc/VertcHelper.java +10 -0
  5. package/android/src/main/java/com/volcengine/reactnative/vertc/VertcModule.java +2 -0
  6. package/android/src/main/java/com/volcengine/reactnative/vertc/VertcView.java +1 -1
  7. package/android/src/main/java/com/volcengine/reactnative/vertc/VertcViewManager.java +1 -1
  8. package/ios/core/VertcHelper.h +21 -0
  9. package/ios/core/VertcHelper.m +42 -0
  10. package/ios/live/VertcLive.h +24 -0
  11. package/ios/live/VertcLive.m +124 -0
  12. package/lib/commonjs/index.js +206 -11
  13. package/lib/module/index.js +206 -11
  14. package/lib/typescript/core/callback.d.ts +1 -1
  15. package/lib/typescript/core/rtc-video.d.ts +33 -1
  16. package/lib/typescript/core.d.ts +0 -4
  17. package/lib/typescript/interface.d.ts +53 -1
  18. package/lib/typescript/platforms/android/live.d.ts +8 -0
  19. package/lib/typescript/platforms/android/vertc.d.ts +2 -0
  20. package/lib/typescript/platforms/ios/live.d.ts +9 -0
  21. package/lib/typescript/platforms/ios/vertc.d.ts +10 -0
  22. package/package.json +1 -1
  23. package/react-native-rtc.podspec +44 -27
  24. /package/android/src/{main → vod}/java/com/volcengine/reactnative/vertc/vod/OESTextureProcessor.java +0 -0
  25. /package/android/src/{main → vod}/java/com/volcengine/reactnative/vertc/vod/VertcVod.java +0 -0
  26. /package/android/src/{main → vod}/java/com/volcengine/reactnative/vertc/vod/VideoAudioProcessor.java +0 -0
  27. /package/android/src/{main → vod}/java/com/volcengine/reactnative/vertc/vod/VodAudioProcessor.java +0 -0
  28. /package/android/src/{main → vod}/java/com/volcengine/reactnative/vertc/vod/VodMock.java +0 -0
  29. /package/android/src/{main → vod}/java/com/volcengine/reactnative/vertc/vod/VodVideoEngineCallbackProxy.java +0 -0
  30. /package/ios/{RTCHeader.h → core/RTCHeader.h} +0 -0
  31. /package/ios/{RTCHeader.m → core/RTCHeader.m} +0 -0
  32. /package/ios/{VertcApiEngine.h → core/VertcApiEngine.h} +0 -0
  33. /package/ios/{VertcApiEngine.m → core/VertcApiEngine.m} +0 -0
  34. /package/ios/{VertcModule.h → core/VertcModule.h} +0 -0
  35. /package/ios/{VertcModule.m → core/VertcModule.m} +0 -0
  36. /package/ios/{VertcView.h → core/VertcView.h} +0 -0
  37. /package/ios/{VertcView.m → core/VertcView.m} +0 -0
  38. /package/ios/{VertcViewManager.m → core/VertcViewManager.m} +0 -0
@@ -0,0 +1,42 @@
1
+ // Copyright © 2022 BytePlusRTC All rights reserved.
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ //
5
+ // react-native-rtc
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import "RTCHeader.h"
10
+ #import <VertcHelper.h>
11
+
12
+
13
+ #pragma mark - Helper
14
+ @implementation VertcHelper
15
+
16
+ + (instancetype) getInstance {
17
+ static VertcHelper *instance = nil;
18
+ static dispatch_once_t onceToken;
19
+ dispatch_once(&onceToken, ^{
20
+ instance = [[VertcHelper alloc] init];
21
+ });
22
+ return instance;
23
+ }
24
+
25
+ - (void)onStreamPushEvent:(ByteRTCSingleStreamPushEvent)event
26
+ taskId:(NSString *_Nonnull)taskID
27
+ error:(NSInteger)errorCode {
28
+ NSLog(@"startPushSingleStreamToCDN: event=%ld, taskID=%@, error=%ld", (long)event, taskID, (long)errorCode);
29
+ }
30
+
31
+ - (int)invokeStartPushSingleStreamToCDN:(ByteRTCVideo *)rtc taskId:(NSString *_Nonnull)taskID singleStream:(ByteRTCPushSingleStreamParam *_Nonnull)singleStream {
32
+ // Compatible live rtc version.
33
+ if ([singleStream respondsToSelector:NSSelectorFromString(@"setPushType:")]) {
34
+ // Can only use 1 magic number.
35
+ [singleStream setValue:@(1) forKey:@"pushType"];
36
+ }
37
+ singleStream.isScreen = singleStream.isScreen || false;
38
+ int res = [rtc startPushSingleStreamToCDN:taskID singleStream:singleStream observer:self];
39
+ return res;
40
+ }
41
+
42
+ @end
@@ -0,0 +1,24 @@
1
+ // Copyright © 2022 BytePlusRTC All rights reserved.
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ //
5
+ // VertcLive.h
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import "RTCHeader.h"
10
+ #import <TTSDKFramework/TTSDKFramework.h>
11
+
12
+ @interface VertcLive : NSObject
13
+
14
+ - (int) startLiveVideoCapture:(ByteRTCVideo *)rtc viewId:(NSString *)viewId options:(NSDictionary *)options;
15
+
16
+ - (int) stopLiveVideoCapture;
17
+
18
+ - (VeLiveVideoFrameSource)getObservedVideoFrameSource;
19
+
20
+ - (ByteRTCVideoPixelFormat)convertToRtcPixelFormat:(VeLivePixelFormat)format;
21
+
22
+ - (void)onPreEncodeVideoFrame:(VeLiveVideoFrame *)frame;
23
+
24
+ @end
@@ -0,0 +1,124 @@
1
+ // Copyright © 2022 BytePlusRTC All rights reserved.
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ #import "VertcLive.h"
5
+ #import "RTCHeader.h"
6
+ #import <TTSDKFramework/TTSDKFramework.h>
7
+ #import <TTSDKFramework/VeLivePusherDef.h>
8
+ #import "VeLivePushHelper.h"
9
+
10
+
11
+
12
+ @interface VertcLive ()
13
+
14
+ @property (nonatomic, strong) NSDictionary *options;
15
+ @property (nonatomic, strong) ByteRTCVideo *rtcEngine;
16
+ @property (nonatomic, strong) VeLivePusher *livePusher;
17
+ @property (nonatomic, strong) id<VeLiveVideoFrameListener> videoFrameListener;
18
+
19
+ @end
20
+
21
+ @implementation VertcLive
22
+
23
+ - (void)dealloc {
24
+ if (self.livePusher && self.videoFrameListener) {
25
+ [self.livePusher removeVideoFrameListener:self.videoFrameListener];
26
+ }
27
+ self.livePusher = nil;
28
+ self.rtcEngine = nil;
29
+ self.options = nil;
30
+ }
31
+
32
+ - (int)startLiveVideoCapture:(ByteRTCVideo *)rtc viewId:(NSString *)viewId options:(NSDictionary *)options {
33
+
34
+ VeLivePusher *pusher = [VeLivePushHelper getPusher:viewId];
35
+ if (pusher == nil) {
36
+ @throw [NSException exceptionWithName:@"unknown videoEngine" reason:@"can't get pusher" userInfo:@{}];
37
+ }
38
+ self.rtcEngine = rtc;
39
+ self.options = options;
40
+ self.livePusher = pusher;
41
+
42
+ NSInteger streamIndexValue = [options[@"streamIndex"] integerValue] ?: 0;
43
+ ByteRTCStreamIndex streamIndex = (streamIndexValue == 1) ? ByteRTCStreamIndexScreen : ByteRTCStreamIndexMain;
44
+ [rtc setVideoSourceType:ByteRTCVideoSourceTypeExternal WithStreamIndex:streamIndex];
45
+
46
+ int addRes = [self.livePusher addVideoFrameListener:self];
47
+ NSLog(@"addVideoFrameListener result: %d", addRes);
48
+
49
+ return 0;
50
+ }
51
+
52
+ - (int)stopLiveVideoCapture {
53
+ if (self.rtcEngine == nil || self.livePusher == nil) {
54
+ return 0;
55
+ }
56
+ if (self.livePusher && self.videoFrameListener) {
57
+ [self.livePusher removeVideoFrameListener:self.videoFrameListener];
58
+ self.videoFrameListener = nil;
59
+ }
60
+ NSInteger streamIndexValue = [self.options[@"streamIndex"] integerValue] ?: 0;
61
+ ByteRTCStreamIndex streamIndex = (streamIndexValue == 1) ? ByteRTCStreamIndexScreen : ByteRTCStreamIndexMain;
62
+ [self.rtcEngine setVideoSourceType:ByteRTCVideoSourceTypeInternal WithStreamIndex:streamIndex];
63
+
64
+ [self.livePusher removeVideoFrameListener:self];
65
+
66
+ self.options = nil;
67
+ self.rtcEngine = nil;
68
+ self.livePusher = nil;
69
+ return 0;
70
+ }
71
+
72
+ - (VeLiveVideoFrameSource)getObservedVideoFrameSource {
73
+ return VeLiveVideoFrameSourcePreEncode;
74
+ }
75
+
76
+ - (ByteRTCVideoPixelFormat)convertToRtcPixelFormat:(VeLivePixelFormat)format {
77
+ switch (format) {
78
+ case VeLivePixelFormatBGRA32: return ByteRTCVideoPixelFormatBGRA;
79
+ case VeLivePixelFormatNV12: return ByteRTCVideoPixelFormatNV12;
80
+ case VeLivePixelFormatNV21: return ByteRTCVideoPixelFormatNV21;
81
+ case VeLivePixelFormatI420: return ByteRTCVideoPixelFormatI420;
82
+ case VeLivePixelFormat2DTexture: return ByteRTCVideoPixelFormatGLTexture2D;
83
+ case VeLiveVideoBufferTypeUnKnown: return ByteRTCVideoPixelFormatUnknown;
84
+ }
85
+ return ByteRTCVideoPixelFormatUnknown;
86
+ }
87
+
88
+ - (void)onPreEncodeVideoFrame:(VeLiveVideoFrame *)frame {
89
+
90
+ NSInteger streamIndexValue = [self.options[@"streamIndex"] integerValue] ?: 0;
91
+ ByteRTCStreamIndex streamIndex = (streamIndexValue == 1) ? ByteRTCStreamIndexScreen : ByteRTCStreamIndexMain;
92
+
93
+ int res = 0;
94
+ if (streamIndex == ByteRTCStreamIndexMain) {
95
+ ByteRTCVideoPixelFormat pixelFormat = [self convertToRtcPixelFormat:frame.pixelFormat];
96
+ ByteRTCVideoFrame *videoFrame = [[ByteRTCVideoFrame alloc] init];
97
+ videoFrame.width = frame.width;
98
+ videoFrame.height = frame.height;
99
+ videoFrame.format = (int)pixelFormat;
100
+ videoFrame.time = frame.pts;
101
+ // videoFrame.contentType = ByteRTCVideoContentTypeNormalFrame;
102
+ // same enum
103
+ videoFrame.rotation = (ByteRTCVideoRotation)frame.rotation;
104
+
105
+ if (frame.sampleBuffer) {
106
+ videoFrame.textureBuf = CMSampleBufferGetImageBuffer(frame.sampleBuffer);
107
+ videoFrame.time = CMSampleBufferGetPresentationTimeStamp(frame.sampleBuffer);
108
+ }
109
+
110
+ if (frame.pixelBuffer) {
111
+ videoFrame.textureBuf = frame.pixelBuffer;
112
+ }
113
+
114
+ res = [self.rtcEngine pushExternalVideoFrame: videoFrame];
115
+ }
116
+ if (streamIndex == ByteRTCStreamIndexScreen) {
117
+ res = [self.rtcEngine pushScreenVideoFrame:frame.pixelBuffer time:frame.pts rotation:frame.rotation];
118
+ }
119
+ if (res != 0 && res != -202) {
120
+ NSLog(@"bytertc push video frame fail return '%d'", res);
121
+ }
122
+ }
123
+
124
+ @end
@@ -68201,7 +68201,83 @@ var VertcVod = function () {
68201
68201
  return _classThis;
68202
68202
  }();
68203
68203
 
68204
- var VertcHelper = function () {
68204
+ var VertcLive$1 = function () {
68205
+ var _classDecorators = [NativeClass('com.volcengine.reactnative.vertc.live.VertcLive')];
68206
+ var _classDescriptor;
68207
+ var _classExtraInitializers = [];
68208
+ var _classThis;
68209
+ var _instanceExtraInitializers = [];
68210
+ var _startLiveVideoCapture_decorators;
68211
+ var _stopLiveVideoCapture_decorators;
68212
+ _classThis = /** @class */ (function () {
68213
+ function VertcLive_1() {
68214
+ __runInitializers(this, _instanceExtraInitializers);
68215
+ }
68216
+ VertcLive_1.prototype.startLiveVideoCapture = function (video, viewId, options) {
68217
+ throw new Error('not implement');
68218
+ };
68219
+ VertcLive_1.prototype.stopLiveVideoCapture = function () {
68220
+ throw new Error('not implement');
68221
+ };
68222
+ return VertcLive_1;
68223
+ }());
68224
+ __setFunctionName(_classThis, "VertcLive");
68225
+ (function () {
68226
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
68227
+ _startLiveVideoCapture_decorators = [NativeMethod()];
68228
+ _stopLiveVideoCapture_decorators = [NativeMethod()];
68229
+ __esDecorate(_classThis, null, _startLiveVideoCapture_decorators, { kind: "method", name: "startLiveVideoCapture", static: false, private: false, access: { has: function (obj) { return "startLiveVideoCapture" in obj; }, get: function (obj) { return obj.startLiveVideoCapture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68230
+ __esDecorate(_classThis, null, _stopLiveVideoCapture_decorators, { kind: "method", name: "stopLiveVideoCapture", static: false, private: false, access: { has: function (obj) { return "stopLiveVideoCapture" in obj; }, get: function (obj) { return obj.stopLiveVideoCapture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68231
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
68232
+ _classThis = _classDescriptor.value;
68233
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
68234
+ __runInitializers(_classThis, _classExtraInitializers);
68235
+ })();
68236
+ return _classThis;
68237
+ }();
68238
+
68239
+ var VertcLive = function () {
68240
+ var _classDecorators = [NativeClass('VertcLive')];
68241
+ var _classDescriptor;
68242
+ var _classExtraInitializers = [];
68243
+ var _classThis;
68244
+ var _instanceExtraInitializers = [];
68245
+ var _init_decorators;
68246
+ var _startLiveVideoCapture_decorators;
68247
+ var _stopLiveVideoCapture_decorators;
68248
+ _classThis = /** @class */ (function () {
68249
+ function VertcLive_1() {
68250
+ __runInitializers(this, _instanceExtraInitializers);
68251
+ }
68252
+ VertcLive_1.prototype.init = function () {
68253
+ throw new Error('not implement');
68254
+ };
68255
+ VertcLive_1.prototype.startLiveVideoCapture = function (video, viewId, options) {
68256
+ throw new Error('not implement');
68257
+ };
68258
+ VertcLive_1.prototype.stopLiveVideoCapture = function () {
68259
+ throw new Error('not implement');
68260
+ };
68261
+ return VertcLive_1;
68262
+ }());
68263
+ __setFunctionName(_classThis, "VertcLive");
68264
+ (function () {
68265
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
68266
+ _init_decorators = [NativeMethodSync('init')];
68267
+ _startLiveVideoCapture_decorators = [NativeMethod('startLiveVideoCapture:viewId:options:')];
68268
+ _stopLiveVideoCapture_decorators = [NativeMethod('stopLiveVideoCapture')];
68269
+ __esDecorate(_classThis, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: function (obj) { return "init" in obj; }, get: function (obj) { return obj.init; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68270
+ __esDecorate(_classThis, null, _startLiveVideoCapture_decorators, { kind: "method", name: "startLiveVideoCapture", static: false, private: false, access: { has: function (obj) { return "startLiveVideoCapture" in obj; }, get: function (obj) { return obj.startLiveVideoCapture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68271
+ __esDecorate(_classThis, null, _stopLiveVideoCapture_decorators, { kind: "method", name: "stopLiveVideoCapture", static: false, private: false, access: { has: function (obj) { return "stopLiveVideoCapture" in obj; }, get: function (obj) { return obj.stopLiveVideoCapture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68272
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
68273
+ _classThis = _classDescriptor.value;
68274
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
68275
+ __runInitializers(_classThis, _classExtraInitializers);
68276
+ })();
68277
+ return _classThis;
68278
+ }();
68279
+
68280
+ var VertcHelper$1 = function () {
68205
68281
  var _classDecorators = [NativeClass('com.volcengine.reactnative.vertc.VertcHelper')];
68206
68282
  var _classDescriptor;
68207
68283
  var _classExtraInitializers = [];
@@ -68212,6 +68288,7 @@ var VertcHelper = function () {
68212
68288
  var _static_getInstance_decorators;
68213
68289
  var _invokeSetVideoEncoderConfig_decorators;
68214
68290
  var _invokeSetLocalVideoMirrorType_decorators;
68291
+ var _invokeStartPushSingleStreamToCDN_decorators;
68215
68292
  var VertcHelper = _classThis = /** @class */ (function (_super) {
68216
68293
  __extends(VertcHelper_1, _super);
68217
68294
  function VertcHelper_1() {
@@ -68228,6 +68305,9 @@ var VertcHelper = function () {
68228
68305
  VertcHelper_1.prototype.invokeSetLocalVideoMirrorType = function (video, mirrorType) {
68229
68306
  throw new Error('not implement');
68230
68307
  };
68308
+ VertcHelper_1.prototype.invokeStartPushSingleStreamToCDN = function (video, taskId, param) {
68309
+ throw new Error('not implement');
68310
+ };
68231
68311
  return VertcHelper_1;
68232
68312
  }(_classSuper));
68233
68313
  __setFunctionName(_classThis, "VertcHelper");
@@ -68237,9 +68317,54 @@ var VertcHelper = function () {
68237
68317
  _static_getInstance_decorators = [ReturnClass(function () { return VertcHelper; }), NativeStaticMethodSync()];
68238
68318
  _invokeSetVideoEncoderConfig_decorators = [NativeMethod()];
68239
68319
  _invokeSetLocalVideoMirrorType_decorators = [NativeMethod()];
68320
+ _invokeStartPushSingleStreamToCDN_decorators = [NativeMethod()];
68240
68321
  __esDecorate(_classThis, null, _static_getInstance_decorators, { kind: "method", name: "getInstance", static: true, private: false, access: { has: function (obj) { return "getInstance" in obj; }, get: function (obj) { return obj.getInstance; } }, metadata: _metadata }, null, _staticExtraInitializers);
68241
68322
  __esDecorate(_classThis, null, _invokeSetVideoEncoderConfig_decorators, { kind: "method", name: "invokeSetVideoEncoderConfig", static: false, private: false, access: { has: function (obj) { return "invokeSetVideoEncoderConfig" in obj; }, get: function (obj) { return obj.invokeSetVideoEncoderConfig; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68242
68323
  __esDecorate(_classThis, null, _invokeSetLocalVideoMirrorType_decorators, { kind: "method", name: "invokeSetLocalVideoMirrorType", static: false, private: false, access: { has: function (obj) { return "invokeSetLocalVideoMirrorType" in obj; }, get: function (obj) { return obj.invokeSetLocalVideoMirrorType; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68324
+ __esDecorate(_classThis, null, _invokeStartPushSingleStreamToCDN_decorators, { kind: "method", name: "invokeStartPushSingleStreamToCDN", static: false, private: false, access: { has: function (obj) { return "invokeStartPushSingleStreamToCDN" in obj; }, get: function (obj) { return obj.invokeStartPushSingleStreamToCDN; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68325
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
68326
+ VertcHelper = _classThis = _classDescriptor.value;
68327
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
68328
+ __runInitializers(_classThis, _staticExtraInitializers);
68329
+ __runInitializers(_classThis, _classExtraInitializers);
68330
+ })();
68331
+ return VertcHelper = _classThis;
68332
+ }();
68333
+
68334
+ var VertcHelper = function () {
68335
+ var _classDecorators = [NativeClass('VertcHelper')];
68336
+ var _classDescriptor;
68337
+ var _classExtraInitializers = [];
68338
+ var _classThis;
68339
+ var _staticExtraInitializers = [];
68340
+ var _instanceExtraInitializers = [];
68341
+ var _static_getInstance_decorators;
68342
+ var _init_decorators;
68343
+ var _invokeStartPushSingleStreamToCDN_decorators;
68344
+ var VertcHelper = _classThis = /** @class */ (function () {
68345
+ function VertcHelper_1() {
68346
+ __runInitializers(this, _instanceExtraInitializers);
68347
+ }
68348
+ VertcHelper_1.prototype.init = function () {
68349
+ throw new Error('not implement');
68350
+ };
68351
+ VertcHelper_1.getInstance = function () {
68352
+ throw new Error('not implement');
68353
+ };
68354
+ VertcHelper_1.prototype.invokeStartPushSingleStreamToCDN = function (video, taskId, param) {
68355
+ throw new Error('not implement');
68356
+ };
68357
+ return VertcHelper_1;
68358
+ }());
68359
+ __setFunctionName(_classThis, "VertcHelper");
68360
+ (function () {
68361
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
68362
+ _init_decorators = [NativeMethodSync('init')];
68363
+ _static_getInstance_decorators = [ReturnClass(function () { return VertcHelper; }), NativeStaticMethodSync('getInstance')];
68364
+ _invokeStartPushSingleStreamToCDN_decorators = [NativeMethod('invokeStartPushSingleStreamToCDN:taskId:singleStream:')];
68365
+ __esDecorate(_classThis, null, _static_getInstance_decorators, { kind: "method", name: "getInstance", static: true, private: false, access: { has: function (obj) { return "getInstance" in obj; }, get: function (obj) { return obj.getInstance; } }, metadata: _metadata }, null, _staticExtraInitializers);
68366
+ __esDecorate(_classThis, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: function (obj) { return "init" in obj; }, get: function (obj) { return obj.init; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68367
+ __esDecorate(_classThis, null, _invokeStartPushSingleStreamToCDN_decorators, { kind: "method", name: "invokeStartPushSingleStreamToCDN", static: false, private: false, access: { has: function (obj) { return "invokeStartPushSingleStreamToCDN" in obj; }, get: function (obj) { return obj.invokeStartPushSingleStreamToCDN; } }, metadata: _metadata }, null, _instanceExtraInitializers);
68243
68368
  __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
68244
68369
  VertcHelper = _classThis = _classDescriptor.value;
68245
68370
  if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
@@ -68307,15 +68432,17 @@ extendsClassMember(RemoteVideoStats, 'codecType')(function () {
68307
68432
  });
68308
68433
  extendsClassMethod(android_RTCRoomEventHandler, 'onStreamRemove', function () {
68309
68434
  return function impl(stream, reason) {
68435
+ var _a, _b;
68310
68436
  if (this._instance.onStreamRemove) {
68311
- this._instance.onStreamRemove(packObject(stream, RTCStream), t_StreamRemoveReason.android_to_ts(reason));
68437
+ (_b = (_a = this._instance).onStreamRemove) === null || _b === void 0 ? void 0 : _b.call(_a, packObject(stream, RTCStream), t_StreamRemoveReason.android_to_ts(reason));
68312
68438
  }
68313
68439
  };
68314
68440
  });
68315
68441
  extendsClassMethod(ios_RTCRoomEventHandler, 'rtcRoom$onStreamRemove$stream$reason', function () {
68316
68442
  return function impl(rtcRoom, uid, stream, reason) {
68443
+ var _a, _b;
68317
68444
  if (this._instance.onStreamRemove) {
68318
- this._instance.onStreamRemove(packObject(stream, RTCStream), t_StreamRemoveReason.ios_to_ts(reason));
68445
+ (_b = (_a = this._instance).onStreamRemove) === null || _b === void 0 ? void 0 : _b.call(_a, packObject(stream, RTCStream), t_StreamRemoveReason.ios_to_ts(reason));
68319
68446
  }
68320
68447
  };
68321
68448
  });
@@ -68483,11 +68610,52 @@ extendsClassMethod(RTCVideo, 'stopVodPlayerCapture', function () {
68483
68610
  }
68484
68611
  };
68485
68612
  });
68613
+ var LiveHelperKey = '_live';
68614
+ extendsClassMethod(RTCVideo, 'startLiveVideoCapture', function () {
68615
+ return function impl(viewId, options) {
68616
+ var _this = this;
68617
+ if (options === void 0) { options = {}; }
68618
+ if (!viewId) {
68619
+ throw new Error('Live player view id is required.');
68620
+ }
68621
+ var a = function () {
68622
+ var androidRtc = unpackObject(_this);
68623
+ var ins = new VertcLive$1();
68624
+ _this[LiveHelperKey] = ins;
68625
+ return ins.startLiveVideoCapture(androidRtc, viewId, options);
68626
+ };
68627
+ var i = function () {
68628
+ var iosRtc = unpackObject(_this);
68629
+ var ins = new VertcLive();
68630
+ _this[LiveHelperKey] = ins;
68631
+ return ins.startLiveVideoCapture(iosRtc, viewId, options);
68632
+ };
68633
+ var $os = env.getOS();
68634
+ if ($os === 'android') {
68635
+ return a();
68636
+ }
68637
+ else if ($os === 'ios') {
68638
+ return i();
68639
+ }
68640
+ else {
68641
+ throw new Error('Not Support Platform ' + $os);
68642
+ }
68643
+ };
68644
+ });
68645
+ extendsClassMethod(RTCVideo, 'stopLiveVideoCapture', function () {
68646
+ return function impl() {
68647
+ var ins = this[LiveHelperKey];
68648
+ if (!ins) {
68649
+ return -2;
68650
+ }
68651
+ return ins.stopLiveVideoCapture();
68652
+ };
68653
+ });
68486
68654
  extendsClassMethod(RTCVideo, 'setVideoEncoderConfig', function (origin) {
68487
68655
  return function impl(channelSolutions) {
68488
68656
  var _this = this;
68489
68657
  var a = function () {
68490
- var vertc = VertcHelper.getInstance();
68658
+ var vertc = VertcHelper$1.getInstance();
68491
68659
  return vertc.invokeSetVideoEncoderConfig(unpackObject(_this), channelSolutions.map(function (item) { return unpackObject(item); }));
68492
68660
  };
68493
68661
  var i = function () {
@@ -68505,11 +68673,44 @@ extendsClassMethod(RTCVideo, 'setVideoEncoderConfig', function (origin) {
68505
68673
  }
68506
68674
  };
68507
68675
  });
68676
+ extendsClassMethod(RTCVideo, 'startPushSingleStreamToCDN', function () {
68677
+ return function impl(taskId, params) {
68678
+ var _this = this;
68679
+ var a = function () {
68680
+ var vertc = VertcHelper$1.getInstance();
68681
+ var streamParams = new PushSingleStreamParam$1();
68682
+ streamParams.roomId = params.roomId;
68683
+ streamParams.userId = params.userId;
68684
+ streamParams.url = params.url;
68685
+ streamParams.isScreen = params.isScreen || false;
68686
+ return vertc.invokeStartPushSingleStreamToCDN(unpackObject(_this), taskId, streamParams);
68687
+ };
68688
+ var i = function () {
68689
+ var vertc = VertcHelper.getInstance();
68690
+ var streamParams = new ByteRTCPushSingleStreamParam();
68691
+ streamParams.roomId = params.roomId;
68692
+ streamParams.userId = params.userId;
68693
+ streamParams.url = params.url;
68694
+ streamParams.isScreen = params.isScreen || false;
68695
+ return vertc.invokeStartPushSingleStreamToCDN(unpackObject(_this), taskId, streamParams);
68696
+ };
68697
+ var $os = env.getOS();
68698
+ if ($os === 'android') {
68699
+ return a().then(Number);
68700
+ }
68701
+ else if ($os === 'ios') {
68702
+ return i().then(Number);
68703
+ }
68704
+ else {
68705
+ throw new Error('Not Support Platform ' + $os);
68706
+ }
68707
+ };
68708
+ });
68508
68709
  extendsClassMethod(RTCVideo, 'setLocalVideoMirrorType', function (origin) {
68509
68710
  return function impl(mirrorType) {
68510
68711
  var _this = this;
68511
68712
  var a = function () {
68512
- var vertc = VertcHelper.getInstance();
68713
+ var vertc = VertcHelper$1.getInstance();
68513
68714
  return vertc.invokeSetLocalVideoMirrorType(unpackObject(_this), t_MirrorType.ts_to_android(mirrorType));
68514
68715
  };
68515
68716
  var i = function () {
@@ -69000,12 +69201,6 @@ var RTCManager = /** @class */ (function () {
69000
69201
  });
69001
69202
  return RTCVideo.setLogConfig(logConfig);
69002
69203
  };
69003
- /** {en}
69004
- * @brief Set vod-player instance
69005
- */
69006
- RTCManager.prototype.setVodPlayer = function (vodPlayer) {
69007
- this.vodPlayer = vodPlayer;
69008
- };
69009
69204
  return RTCManager;
69010
69205
  }());
69011
69206