@byteplus/react-native-rtc 1.0.2 → 1.0.4
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/README.md +313 -5
- package/android/build.gradle +14 -33
- package/android/src/main/java/com/volcengine/reactnative/vertc/VertcViewManager.java +1 -1
- package/android/src/main/java/com/volcengine/reactnative/vertc/events/ClassHelper.java +149 -0
- package/android/src/main/java/com/volcengine/reactnative/vertc/vod/VertcVod.java +29 -13
- package/android/src/main/java/com/volcengine/reactnative/vertc/vod/VideoAudioProcessor.java +9 -11
- package/android/src/main/java/com/volcengine/reactnative/vertc/vod/VodMock.java +17 -6
- package/android/src/main/java/com/volcengine/reactnative/vertc/vod/VodVideoEngineCallbackProxy.java +94 -0
- package/ios/VertcView.m +1 -1
- package/ios/VertcViewManager.m +1 -1
- package/ios/vod/VertcVod.m +20 -5
- package/ios/vod/VodAudioProcessor.h +6 -1
- package/ios/vod/VodAudioProcessor.mm +9 -1
- package/ios/vod/VodVideoProcessor.h +3 -1
- package/ios/vod/VodVideoProcessor.m +22 -2
- package/lib/commonjs/index.js +132 -17
- package/lib/module/index.js +132 -17
- package/lib/typescript/codegen/pack/keytype.d.ts +3 -3
- package/lib/typescript/component.d.ts +9 -2
- package/lib/typescript/core/rtc-video.d.ts +8 -1
- package/lib/typescript/platforms/android/vod.d.ts +2 -2
- package/package.json +1 -1
- package/react-native-rtc.podspec +39 -16
- package/android/src/main/java/com/volcengine/reactnative/vertc/vod/VodAudioProxy.java +0 -44
- package/android/src/main/java/com/volcengine/reactnative/vertc/vod/VodAudioVoiceWrapperObject.java +0 -355
- package/android/src/main/java/com/volcengine/reactnative/vertc/vod/VodVideoProxy.java +0 -97
package/lib/module/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
import { NativeEventEmitter, Image, Platform, NativeModules, requireNativeComponent } from 'react-native';
|
|
5
|
+
import React from 'react';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* base64.ts
|
|
@@ -310,6 +311,17 @@ function packObject(receiver, ctor) {
|
|
|
310
311
|
function unpackObject(proxyInstance, _nativeClass) {
|
|
311
312
|
return proxyInstance._instance;
|
|
312
313
|
}
|
|
314
|
+
|
|
315
|
+
function findProto(ctor, name) {
|
|
316
|
+
let proto = ctor.prototype;
|
|
317
|
+
while (proto) {
|
|
318
|
+
if (Object.getOwnPropertyDescriptor(proto, name)) {
|
|
319
|
+
return proto;
|
|
320
|
+
}
|
|
321
|
+
proto = Object.getPrototypeOf(proto);
|
|
322
|
+
}
|
|
323
|
+
return undefined;
|
|
324
|
+
}
|
|
313
325
|
function extendsClassMethod(ctor, methodName, overrideFn) {
|
|
314
326
|
const proto = ctor.prototype;
|
|
315
327
|
const originalFn = ctor.prototype[methodName];
|
|
@@ -317,6 +329,24 @@ function extendsClassMethod(ctor, methodName, overrideFn) {
|
|
|
317
329
|
return overrideFn(originalFn?.bind(this)).apply(this, args);
|
|
318
330
|
};
|
|
319
331
|
}
|
|
332
|
+
function extendsClassMember(ctor, memberName) {
|
|
333
|
+
return (handler) => {
|
|
334
|
+
const targetProto = findProto(ctor, memberName);
|
|
335
|
+
const originalDesc = targetProto
|
|
336
|
+
? Object.getOwnPropertyDescriptor(targetProto, memberName)
|
|
337
|
+
: undefined;
|
|
338
|
+
const newDesc = handler({
|
|
339
|
+
getter: originalDesc?.get,
|
|
340
|
+
setter: originalDesc?.set,
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(ctor.prototype, memberName, {
|
|
343
|
+
enumerable: originalDesc?.enumerable ?? true,
|
|
344
|
+
configurable: originalDesc?.configurable ?? true,
|
|
345
|
+
get: newDesc.getter || originalDesc?.get,
|
|
346
|
+
set: newDesc.setter || originalDesc?.set,
|
|
347
|
+
});
|
|
348
|
+
};
|
|
349
|
+
}
|
|
320
350
|
|
|
321
351
|
let impl;
|
|
322
352
|
function setupEnv(e) {
|
|
@@ -43374,9 +43404,9 @@ var LocalProxyError;
|
|
|
43374
43404
|
})(LocalProxyError || (LocalProxyError = {}));
|
|
43375
43405
|
var MediaStreamType;
|
|
43376
43406
|
(function (MediaStreamType) {
|
|
43377
|
-
MediaStreamType[MediaStreamType["RTC_MEDIA_STREAM_TYPE_AUDIO"] =
|
|
43378
|
-
MediaStreamType[MediaStreamType["RTC_MEDIA_STREAM_TYPE_VIDEO"] =
|
|
43379
|
-
MediaStreamType[MediaStreamType["RTC_MEDIA_STREAM_TYPE_BOTH"] =
|
|
43407
|
+
MediaStreamType[MediaStreamType["RTC_MEDIA_STREAM_TYPE_AUDIO"] = 1] = "RTC_MEDIA_STREAM_TYPE_AUDIO";
|
|
43408
|
+
MediaStreamType[MediaStreamType["RTC_MEDIA_STREAM_TYPE_VIDEO"] = 2] = "RTC_MEDIA_STREAM_TYPE_VIDEO";
|
|
43409
|
+
MediaStreamType[MediaStreamType["RTC_MEDIA_STREAM_TYPE_BOTH"] = 3] = "RTC_MEDIA_STREAM_TYPE_BOTH";
|
|
43380
43410
|
})(MediaStreamType || (MediaStreamType = {}));
|
|
43381
43411
|
var MediaDeviceState;
|
|
43382
43412
|
(function (MediaDeviceState) {
|
|
@@ -67090,7 +67120,7 @@ var VertcVod$1 = function () {
|
|
|
67090
67120
|
function VertcVod_1() {
|
|
67091
67121
|
__runInitializers(this, _instanceExtraInitializers);
|
|
67092
67122
|
}
|
|
67093
|
-
VertcVod_1.prototype.startVodPlayerCapture = function (video, player,
|
|
67123
|
+
VertcVod_1.prototype.startVodPlayerCapture = function (video, player, options) {
|
|
67094
67124
|
throw new Error('not implement');
|
|
67095
67125
|
};
|
|
67096
67126
|
VertcVod_1.prototype.stopVodPlayerCapture = function (video) {
|
|
@@ -67154,6 +67184,77 @@ var VertcVod = function () {
|
|
|
67154
67184
|
return _classThis;
|
|
67155
67185
|
}();
|
|
67156
67186
|
|
|
67187
|
+
extendsClassMember(LocalVideoStats, 'codecType')(function () {
|
|
67188
|
+
return {
|
|
67189
|
+
getter: function () {
|
|
67190
|
+
var _a;
|
|
67191
|
+
var $os = env.getOS();
|
|
67192
|
+
if ($os === 'android') {
|
|
67193
|
+
var value = this._instance.codecType;
|
|
67194
|
+
var $m = (_a = {},
|
|
67195
|
+
_a[VideoCodecType.VIDEO_CODEC_TYPE_H264] = VideoCodecType.VIDEO_CODEC_TYPE_H264,
|
|
67196
|
+
_a[VideoCodecType.VIDEO_CODEC_TYPE_BYTEVC1] = VideoCodecType.VIDEO_CODEC_TYPE_BYTEVC1,
|
|
67197
|
+
_a[VideoConfig$VideoCodecType.VIDEO_CODEC_TYPE_H264] = VideoCodecType.VIDEO_CODEC_TYPE_H264,
|
|
67198
|
+
_a[VideoConfig$VideoCodecType.VIDEO_CODEC_TYPE_BYTEVC1] = VideoCodecType.VIDEO_CODEC_TYPE_BYTEVC1,
|
|
67199
|
+
_a);
|
|
67200
|
+
if (!(value in $m)) {
|
|
67201
|
+
throw new Error('invalid value:' + value);
|
|
67202
|
+
}
|
|
67203
|
+
// @ts-ignore
|
|
67204
|
+
return $m[value];
|
|
67205
|
+
}
|
|
67206
|
+
else if ($os === 'ios') {
|
|
67207
|
+
return t_VideoCodecType.ios_to_ts(this._instance.codecType);
|
|
67208
|
+
}
|
|
67209
|
+
else {
|
|
67210
|
+
throw new Error('Not Support Platform ' + $os);
|
|
67211
|
+
}
|
|
67212
|
+
},
|
|
67213
|
+
};
|
|
67214
|
+
});
|
|
67215
|
+
extendsClassMember(RemoteVideoStats, 'codecType')(function () {
|
|
67216
|
+
return {
|
|
67217
|
+
getter: function () {
|
|
67218
|
+
var _a;
|
|
67219
|
+
var $os = env.getOS();
|
|
67220
|
+
if ($os === 'android') {
|
|
67221
|
+
var value = this._instance.codecType;
|
|
67222
|
+
var $m = (_a = {},
|
|
67223
|
+
_a[VideoCodecType.VIDEO_CODEC_TYPE_H264] = VideoCodecType.VIDEO_CODEC_TYPE_H264,
|
|
67224
|
+
_a[VideoCodecType.VIDEO_CODEC_TYPE_BYTEVC1] = VideoCodecType.VIDEO_CODEC_TYPE_BYTEVC1,
|
|
67225
|
+
_a[VideoConfig$VideoCodecType.VIDEO_CODEC_TYPE_H264] = VideoCodecType.VIDEO_CODEC_TYPE_H264,
|
|
67226
|
+
_a[VideoConfig$VideoCodecType.VIDEO_CODEC_TYPE_BYTEVC1] = VideoCodecType.VIDEO_CODEC_TYPE_BYTEVC1,
|
|
67227
|
+
_a);
|
|
67228
|
+
if (!(value in $m)) {
|
|
67229
|
+
throw new Error('invalid value:' + value);
|
|
67230
|
+
}
|
|
67231
|
+
// @ts-ignore
|
|
67232
|
+
return $m[value];
|
|
67233
|
+
}
|
|
67234
|
+
else if ($os === 'ios') {
|
|
67235
|
+
return t_VideoCodecType.ios_to_ts(this._instance.codecType);
|
|
67236
|
+
}
|
|
67237
|
+
else {
|
|
67238
|
+
throw new Error('Not Support Platform ' + $os);
|
|
67239
|
+
}
|
|
67240
|
+
},
|
|
67241
|
+
};
|
|
67242
|
+
});
|
|
67243
|
+
extendsClassMethod(android_RTCRoomEventHandler, 'onStreamRemove', function () {
|
|
67244
|
+
return function impl(stream, reason) {
|
|
67245
|
+
if (this._instance.onStreamRemove) {
|
|
67246
|
+
this._instance.onStreamRemove(packObject(stream, RTCStream), t_StreamRemoveReason.android_to_ts(reason));
|
|
67247
|
+
}
|
|
67248
|
+
};
|
|
67249
|
+
});
|
|
67250
|
+
extendsClassMethod(ios_RTCRoomEventHandler, 'rtcRoom$onStreamRemove$stream$reason', function () {
|
|
67251
|
+
return function impl(rtcRoom, uid, stream, reason) {
|
|
67252
|
+
if (this._instance.onStreamRemove) {
|
|
67253
|
+
this._instance.onStreamRemove(packObject(stream, RTCStream), t_StreamRemoveReason.ios_to_ts(reason));
|
|
67254
|
+
}
|
|
67255
|
+
};
|
|
67256
|
+
});
|
|
67257
|
+
|
|
67157
67258
|
extendsClassMethod(RTCVideo, 'feedback', function () {
|
|
67158
67259
|
return function impl(options, info) {
|
|
67159
67260
|
var _this = this;
|
|
@@ -67276,31 +67377,29 @@ extendsClassMethod(RTCVideo, 'setRemoteAudioPlaybackVolume', function () {
|
|
|
67276
67377
|
});
|
|
67277
67378
|
var VodHelperKey = '_vod';
|
|
67278
67379
|
extendsClassMethod(RTCVideo, 'startVodPlayerCapture', function () {
|
|
67279
|
-
return function impl(player) {
|
|
67380
|
+
return function impl(player, options) {
|
|
67280
67381
|
var _this = this;
|
|
67281
|
-
|
|
67382
|
+
if (options === void 0) { options = {}; }
|
|
67383
|
+
if (!player) {
|
|
67384
|
+
throw new Error('Vod player instance is required.');
|
|
67385
|
+
}
|
|
67386
|
+
var unpackedPlayer = unpackObject(player);
|
|
67282
67387
|
var a = function () {
|
|
67283
67388
|
var androidRtc = unpackObject(_this);
|
|
67284
|
-
var androidStreamIndex = t_StreamIndex.ts_to_android(streamIndex);
|
|
67285
|
-
// androidRtc.setVideoSourceType(
|
|
67286
|
-
// androidStreamIndex,
|
|
67287
|
-
// $p_a.VideoSourceType.VIDEO_SOURCE_TYPE_EXTERNAL,
|
|
67288
|
-
// );
|
|
67289
|
-
// androidRtc.setScreenAudioSourceType(
|
|
67290
|
-
// $p_a.AudioSourceType.AUDIO_SOURCE_TYPE_EXTERNAL,
|
|
67291
|
-
// );
|
|
67292
67389
|
var ins = new VertcVod$1();
|
|
67293
67390
|
_this[VodHelperKey] = ins;
|
|
67294
|
-
return ins.startVodPlayerCapture(androidRtc,
|
|
67391
|
+
return ins.startVodPlayerCapture(androidRtc, unpackedPlayer, options);
|
|
67295
67392
|
};
|
|
67296
67393
|
var i = function () {
|
|
67297
67394
|
var iosRtc = unpackObject(_this);
|
|
67298
67395
|
var ins = new VertcVod();
|
|
67299
67396
|
_this[VodHelperKey] = ins;
|
|
67300
|
-
return ins.startVodPlayerCapture(iosRtc,
|
|
67397
|
+
return ins.startVodPlayerCapture(iosRtc, unpackedPlayer, options);
|
|
67301
67398
|
};
|
|
67302
67399
|
var $os = env.getOS();
|
|
67303
67400
|
if ($os === 'android') {
|
|
67401
|
+
// Using surface texutre for rendering.
|
|
67402
|
+
unpackedPlayer.setIntOption(199, 0);
|
|
67304
67403
|
return a();
|
|
67305
67404
|
}
|
|
67306
67405
|
else if ($os === 'ios') {
|
|
@@ -67762,7 +67861,23 @@ var RTCManager = /** @class */ (function () {
|
|
|
67762
67861
|
}());
|
|
67763
67862
|
|
|
67764
67863
|
var NativeViewComponentName = 'VertcView';
|
|
67765
|
-
var
|
|
67864
|
+
var VertcView = requireNativeComponent(NativeViewComponentName);
|
|
67865
|
+
var NativeViewComponent = /** @class */ (function (_super) {
|
|
67866
|
+
__extends(NativeViewComponent, _super);
|
|
67867
|
+
function NativeViewComponent() {
|
|
67868
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
67869
|
+
}
|
|
67870
|
+
NativeViewComponent.prototype.render = function () {
|
|
67871
|
+
var _a = this.props, viewId = _a.viewId, kind = _a.kind, children = _a.children, style = _a.style, onLoad = _a.onLoad;
|
|
67872
|
+
return React.createElement(VertcView, {
|
|
67873
|
+
viewId: viewId,
|
|
67874
|
+
kind: kind,
|
|
67875
|
+
style: style,
|
|
67876
|
+
onViewLoad: onLoad,
|
|
67877
|
+
}, children);
|
|
67878
|
+
};
|
|
67879
|
+
return NativeViewComponent;
|
|
67880
|
+
}(React.Component));
|
|
67766
67881
|
|
|
67767
67882
|
/** {en}
|
|
67768
67883
|
* @detail keytype
|
|
@@ -5922,9 +5922,9 @@ export declare enum LocalProxyError {
|
|
|
5922
5922
|
HTTP_TUNNEL_FAILED = 6
|
|
5923
5923
|
}
|
|
5924
5924
|
export declare enum MediaStreamType {
|
|
5925
|
-
RTC_MEDIA_STREAM_TYPE_AUDIO =
|
|
5926
|
-
RTC_MEDIA_STREAM_TYPE_VIDEO =
|
|
5927
|
-
RTC_MEDIA_STREAM_TYPE_BOTH =
|
|
5925
|
+
RTC_MEDIA_STREAM_TYPE_AUDIO = 1,
|
|
5926
|
+
RTC_MEDIA_STREAM_TYPE_VIDEO = 2,
|
|
5927
|
+
RTC_MEDIA_STREAM_TYPE_BOTH = 3
|
|
5928
5928
|
}
|
|
5929
5929
|
export declare enum MediaDeviceState {
|
|
5930
5930
|
/** {en}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
// Copyright © 2022 BytePlusRTC All rights reserved.
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import React from 'react';
|
|
5
|
+
type VertcViewProps = {
|
|
5
6
|
viewId: string;
|
|
6
7
|
kind: 'SurfaceView' | 'TextureView' | 'View' | 'UIView';
|
|
7
8
|
children?: any;
|
|
8
9
|
style?: any;
|
|
10
|
+
onViewLoad?: () => void;
|
|
11
|
+
};
|
|
12
|
+
export type NativeViewComponentProps = Omit<VertcViewProps, 'onViewLoad'> & {
|
|
9
13
|
onLoad?: () => void;
|
|
10
14
|
};
|
|
11
|
-
export declare
|
|
15
|
+
export declare class NativeViewComponent extends React.Component<NativeViewComponentProps> {
|
|
16
|
+
render(): React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -3,12 +3,19 @@
|
|
|
3
3
|
|
|
4
4
|
import { RTCVideo, type ProblemFeedbackOption } from '../codegen/pack';
|
|
5
5
|
import type { IFeedbackProblemInfo, IRemoteStreamInfo } from '../interface';
|
|
6
|
+
import './callback';
|
|
6
7
|
declare module '../codegen/pack' {
|
|
8
|
+
interface IVodPlayerCaptureOptions {
|
|
9
|
+
/**
|
|
10
|
+
* video fps
|
|
11
|
+
*/
|
|
12
|
+
fps?: number;
|
|
13
|
+
}
|
|
7
14
|
interface RTCVideo {
|
|
8
15
|
feedback(options: ProblemFeedbackOption[], info: IFeedbackProblemInfo): number;
|
|
9
16
|
setRuntimeParameters(params: Record<string, string>): number;
|
|
10
17
|
setRemoteAudioPlaybackVolume(config: IRemoteStreamInfo, volume: number): void;
|
|
11
|
-
startVodPlayerCapture(player: any): Promise<void>;
|
|
18
|
+
startVodPlayerCapture(player: any, options?: IVodPlayerCaptureOptions): Promise<void>;
|
|
12
19
|
stopVodPlayerCapture(player: any): Promise<void>;
|
|
13
20
|
}
|
|
14
21
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Copyright © 2022 BytePlusRTC All rights reserved.
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
-
import { RTCVideo
|
|
4
|
+
import { RTCVideo } from '../../codegen/android';
|
|
5
5
|
export declare class VertcVod {
|
|
6
|
-
startVodPlayerCapture(video: RTCVideo, player: any,
|
|
6
|
+
startVodPlayerCapture(video: RTCVideo, player: any, options: Record<string, any>): Promise<void>;
|
|
7
7
|
stopVodPlayerCapture(video: RTCVideo): Promise<void>;
|
|
8
8
|
}
|
package/package.json
CHANGED
package/react-native-rtc.podspec
CHANGED
|
@@ -22,8 +22,16 @@ Pod::Spec.new do |s|
|
|
|
22
22
|
s.authors = package["author"]
|
|
23
23
|
|
|
24
24
|
s.platforms = { :ios => min_ios_version_supported }
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
|
|
26
|
+
if is_bp
|
|
27
|
+
s.source = { :git => "https://github.com/byteplus-sdk/byteplus-specs.git", :tag => "#{s.version}" }
|
|
28
|
+
else
|
|
29
|
+
s.source = { :git => "https://github.com/volcengine/volcengine-specs.git", :tag => "#{s.version}" }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
s.pod_target_xcconfig = {
|
|
33
|
+
'ENABLE_UNION_FOR_RTC_WITH_LIVE' => '$(ENABLE_UNION_FOR_RTC_WITH_LIVE)'
|
|
34
|
+
}
|
|
27
35
|
|
|
28
36
|
s.source_files = "ios/**/*.{h,m,mm}"
|
|
29
37
|
|
|
@@ -37,11 +45,11 @@ Pod::Spec.new do |s|
|
|
|
37
45
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
38
46
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
39
47
|
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
40
|
-
s.pod_target_xcconfig
|
|
48
|
+
s.pod_target_xcconfig.merge!({
|
|
41
49
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
42
50
|
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
43
51
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
44
|
-
}
|
|
52
|
+
})
|
|
45
53
|
s.dependency "React-Codegen"
|
|
46
54
|
s.dependency "RCT-Folly"
|
|
47
55
|
s.dependency "RCTRequired"
|
|
@@ -50,19 +58,34 @@ Pod::Spec.new do |s|
|
|
|
50
58
|
end
|
|
51
59
|
end
|
|
52
60
|
|
|
53
|
-
s.dependency 'VolcApiEngine', '1.
|
|
61
|
+
s.dependency 'VolcApiEngine', '1.6.2'
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
s.dependency 'BytePlusRTC', '3.58.1.14800'
|
|
57
|
-
# else
|
|
63
|
+
enable_union = (ENV['ENABLE_UNION_FOR_RTC_WITH_LIVE'] == 'YES')
|
|
58
64
|
|
|
59
|
-
|
|
65
|
+
if is_bp
|
|
66
|
+
rtc_version_byteplus_union = '3.58.1.45300'
|
|
67
|
+
rtc_version_byteplus_non_union = '3.58.1.14800'
|
|
68
|
+
rtc_version = enable_union ? rtc_version_byteplus_union : rtc_version_byteplus_non_union
|
|
69
|
+
if enable_union
|
|
70
|
+
s.dependency 'TTSDKFramework/RTCSDK', '1.46.300.1-premium'
|
|
71
|
+
s.dependency 'TTSDKFramework/Player-SR', '1.46.300.1-premium'
|
|
72
|
+
else
|
|
73
|
+
s.dependency 'BytePlusRTC', rtc_version
|
|
74
|
+
s.dependency 'TTSDKFramework/Player-SR', '1.45.300.3-premium'
|
|
75
|
+
end
|
|
76
|
+
puts "React-Native-RTC Pod: Using BytePlusRTC SDK version: #{rtc_version} (union build enabled: #{enable_union})"
|
|
77
|
+
else
|
|
78
|
+
rtc_version_volc_union = '3.58.1.100'
|
|
79
|
+
rtc_version_volc_non_union = '3.58.1.100'
|
|
80
|
+
rtc_version = enable_union ? rtc_version_volc_union : rtc_version_volc_non_union
|
|
81
|
+
if enable_union
|
|
82
|
+
s.dependency 'TTSDKFramework/RTCSDK', '1.46.3.9-premium'
|
|
83
|
+
s.dependency 'TTSDKFramework/Player-SR', '1.46.3.9-premium'
|
|
84
|
+
else
|
|
85
|
+
s.dependency 'VolcEngineRTC', rtc_version
|
|
86
|
+
s.dependency 'TTSDKFramework/Player-SR', '1.46.2.8-premium'
|
|
87
|
+
end
|
|
60
88
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
# byteplus and volcengine use same name, different version
|
|
64
|
-
# volcengine 1.43.1.9-premium 1.43.1.9-standard
|
|
65
|
-
# byteplus 1.45.300.3-premium 1.45.300.3-standard
|
|
66
|
-
# For 1.0.1-rc.3 version.
|
|
67
|
-
s.dependency 'TTSDKFramework/Player-SR', '1.45.300.3-premium'
|
|
89
|
+
puts "React-Native-RTC Pod: Using VolcEngineRTC SDK version: #{rtc_version} (union build enabled: #{enable_union})"
|
|
90
|
+
end
|
|
68
91
|
end
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022 BytePlusRTC All rights reserved.
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
|
|
4
|
-
package com.volcengine.reactnative.vertc.vod;
|
|
5
|
-
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.ss.bytertc.engine.RTCVideo;
|
|
8
|
-
import com.ss.bytertc.engine.data.AudioSourceType;
|
|
9
|
-
import com.ss.ttm.player.TraitObject;
|
|
10
|
-
import com.ss.ttvideoengine.TTVideoEngine;
|
|
11
|
-
|
|
12
|
-
public class VodAudioProxy {
|
|
13
|
-
private String TAG = "VodAudioProxy";
|
|
14
|
-
|
|
15
|
-
private TTVideoEngine mVideoEngine;
|
|
16
|
-
private RTCVideo mRTCVideo;
|
|
17
|
-
|
|
18
|
-
public void initEngine(TTVideoEngine videoEngine, RTCVideo rtcEngine, ReactApplicationContext reactApplicationContext) {
|
|
19
|
-
mVideoEngine = videoEngine;
|
|
20
|
-
mRTCVideo = rtcEngine;
|
|
21
|
-
rtcEngine.setScreenAudioSourceType(AudioSourceType.AUDIO_SOURCE_TYPE_EXTERNAL);
|
|
22
|
-
|
|
23
|
-
// var mVAProcessor = new
|
|
24
|
-
// mVideoEngine.setAudioProcessor(mVAProcessor);
|
|
25
|
-
|
|
26
|
-
// TraitObject traitObj = new VodAudioVoiceWrapperObject(reactApplicationContext.getApplicationContext(), rtcEngine);
|
|
27
|
-
// mVideoEngine.setIntOption(TTVideoEngine.PLAYER_OPTION_SET_VOICE, TTVideoEngine.VOICE_EXTERN);
|
|
28
|
-
// mVideoEngine.setTraitObject(TraitObject.ExtVoice, traitObj);
|
|
29
|
-
|
|
30
|
-
// mVideoEngine.setIntOption(TTVideoEngine.PLAYER_OPTION_EXTERN_VOICE_OUTPUT_FORMAT, VoiceTrait.AV_PCM_FMT_S16);
|
|
31
|
-
|
|
32
|
-
// mVideoEngine.setIntOption(TTVideoEngine.PLAYER_OPTION_SET_VOICE, TTVideoEngine.VOICE_DUMMY);
|
|
33
|
-
// mVideoEngine.setIntOption(TTVideoEngine.PLAYER_OPTION_DUMMY_AUDIO_SLEEP, 0);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public void release() {
|
|
37
|
-
if (mVideoEngine != null) {
|
|
38
|
-
mVideoEngine = null;
|
|
39
|
-
}
|
|
40
|
-
if (mRTCVideo != null) {
|
|
41
|
-
mRTCVideo = null;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|