@100mslive/react-native-hms 0.9.9 → 0.9.91
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 +50 -43
- package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.idea/libraries/{Gradle__com_github_100mslive_android_sdk_lib_2_4_2_aar.xml → Gradle__com_github_100mslive_android_sdk_lib_2_4_7_aar.xml} +4 -4
- package/android/.idea/libraries/Gradle__com_github_100mslive_webrtc_m97_hms_1_1_aar.xml +11 -0
- package/android/.idea/modules/android.androidTest.iml +4 -4
- package/android/.idea/modules/android.main.iml +4 -4
- package/android/.idea/modules/android.unitTest.iml +4 -4
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +84 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +77 -8
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +95 -22
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +86 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +255 -34
- package/ios/HMSDecoder.swift +9 -8
- package/ios/HMSHelper.swift +5 -8
- package/ios/HMSManager.swift +5 -4
- package/ios/HMSRNSDK.swift +27 -32
- package/lib/commonjs/classes/HMSAudioDevice.js +17 -0
- package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -0
- package/lib/commonjs/classes/HMSAudioMixingMode.js +15 -0
- package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -0
- package/lib/commonjs/classes/HMSAudioMode.js +17 -0
- package/lib/commonjs/classes/HMSAudioMode.js.map +1 -0
- package/lib/commonjs/classes/HMSEncoder.js +15 -0
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSException.js +18 -13
- package/lib/commonjs/classes/HMSException.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSPermissions.js +7 -4
- package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +184 -9
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +1 -0
- package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/commonjs/index.js +42 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSAudioDevice.js +10 -0
- package/lib/module/classes/HMSAudioDevice.js.map +1 -0
- package/lib/module/classes/HMSAudioMixingMode.js +8 -0
- package/lib/module/classes/HMSAudioMixingMode.js.map +1 -0
- package/lib/module/classes/HMSAudioMode.js +10 -0
- package/lib/module/classes/HMSAudioMode.js.map +1 -0
- package/lib/module/classes/HMSEncoder.js +14 -0
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSException.js +18 -13
- package/lib/module/classes/HMSException.js.map +1 -1
- package/lib/module/classes/HMSHLSConfig.js.map +1 -1
- package/lib/module/classes/HMSPermissions.js +7 -4
- package/lib/module/classes/HMSPermissions.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +184 -9
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +1 -0
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/classes/HMSAudioDevice.d.ts +7 -0
- package/lib/typescript/classes/HMSAudioMixingMode.d.ts +5 -0
- package/lib/typescript/classes/HMSAudioMode.d.ts +7 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +2 -0
- package/lib/typescript/classes/HMSException.d.ts +8 -14
- package/lib/typescript/classes/HMSHLSConfig.d.ts +2 -2
- package/lib/typescript/classes/HMSPermissions.d.ts +6 -4
- package/lib/typescript/classes/HMSSDK.d.ts +105 -7
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +2 -1
- package/lib/typescript/index.d.ts +3 -0
- package/package.json +1 -1
- package/react-native-hms.podspec +1 -1
- package/src/classes/HMSAudioDevice.ts +7 -0
- package/src/classes/HMSAudioMixingMode.ts +5 -0
- package/src/classes/HMSAudioMode.ts +7 -0
- package/src/classes/HMSEncoder.ts +12 -0
- package/src/classes/HMSException.ts +15 -24
- package/src/classes/HMSHLSConfig.ts +2 -2
- package/src/classes/HMSPermissions.ts +9 -6
- package/src/classes/HMSSDK.tsx +250 -16
- package/src/classes/HMSUpdateListenerActions.ts +1 -0
- package/src/index.ts +3 -0
- package/android/.idea/libraries/Gradle__com_github_100mslive_webrtc_m97_aar.xml +0 -11
|
@@ -96,6 +96,8 @@ class HMSSDK {
|
|
|
96
96
|
|
|
97
97
|
_defineProperty(this, "onRemoteVideoStatsDelegate", void 0);
|
|
98
98
|
|
|
99
|
+
_defineProperty(this, "onAudioDeviceChangedDelegate", void 0);
|
|
100
|
+
|
|
99
101
|
_defineProperty(this, "setLogger", hmsLogger => {
|
|
100
102
|
(0, _HMSLogger.setLogger)(this.id, hmsLogger);
|
|
101
103
|
});
|
|
@@ -132,6 +134,7 @@ class HMSSDK {
|
|
|
132
134
|
HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS, this.onLocalVideoStatsListener);
|
|
133
135
|
HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS, this.onRemoteAudioStatsListener);
|
|
134
136
|
HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS, this.onRemoteVideoStatsListener);
|
|
137
|
+
HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED, this.onAudioDeviceChangedListener);
|
|
135
138
|
});
|
|
136
139
|
|
|
137
140
|
_defineProperty(this, "removeListeners", () => {
|
|
@@ -152,6 +155,7 @@ class HMSSDK {
|
|
|
152
155
|
HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS, this.onLocalVideoStatsListener);
|
|
153
156
|
HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS, this.onRemoteAudioStatsListener);
|
|
154
157
|
HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS, this.onRemoteVideoStatsListener);
|
|
158
|
+
HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED, this.onAudioDeviceChangedListener);
|
|
155
159
|
});
|
|
156
160
|
|
|
157
161
|
_defineProperty(this, "join", async config => {
|
|
@@ -540,27 +544,176 @@ class HMSSDK {
|
|
|
540
544
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function enableRTCStats', {
|
|
541
545
|
id: this.id
|
|
542
546
|
});
|
|
547
|
+
HMSManager.enableRTCStats({
|
|
548
|
+
id: this.id
|
|
549
|
+
});
|
|
550
|
+
});
|
|
543
551
|
|
|
544
|
-
|
|
545
|
-
|
|
552
|
+
_defineProperty(this, "disableRTCStats", () => {
|
|
553
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function disableRTCStats', {
|
|
554
|
+
id: this.id
|
|
555
|
+
});
|
|
556
|
+
HMSManager.disableRTCStats({
|
|
557
|
+
id: this.id
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
_defineProperty(this, "startAudioshare", async audioMixingMode => {
|
|
562
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function startAudioshare', {
|
|
563
|
+
id: this.id,
|
|
564
|
+
audioMixingMode
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
568
|
+
return await HMSManager.startAudioshare({
|
|
569
|
+
id: this.id,
|
|
570
|
+
audioMixingMode
|
|
571
|
+
});
|
|
572
|
+
} else {
|
|
573
|
+
console.log('API currently not available for iOS');
|
|
574
|
+
return 'API currently not available for iOS';
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
_defineProperty(this, "isAudioShared", async () => {
|
|
579
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function isAudioShared', {
|
|
580
|
+
id: this.id
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
584
|
+
return await HMSManager.isAudioShared({
|
|
546
585
|
id: this.id
|
|
547
586
|
});
|
|
548
587
|
} else {
|
|
549
|
-
console.log('API currently not
|
|
588
|
+
console.log('API currently not available for iOS');
|
|
589
|
+
return 'API currently not available for iOS';
|
|
550
590
|
}
|
|
551
591
|
});
|
|
552
592
|
|
|
553
|
-
_defineProperty(this, "
|
|
554
|
-
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function
|
|
593
|
+
_defineProperty(this, "stopAudioshare", async () => {
|
|
594
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function stopAudioshare', {
|
|
555
595
|
id: this.id
|
|
556
596
|
});
|
|
557
597
|
|
|
558
|
-
if (_reactNative.Platform.OS === '
|
|
559
|
-
HMSManager.
|
|
598
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
599
|
+
return await HMSManager.stopAudioshare({
|
|
600
|
+
id: this.id
|
|
601
|
+
});
|
|
602
|
+
} else {
|
|
603
|
+
console.log('API currently not available for iOS');
|
|
604
|
+
return 'API currently not available for iOS';
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
_defineProperty(this, "getAudioMixingMode", async () => {
|
|
609
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getAudioMixingMode', {
|
|
610
|
+
id: this.id
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
614
|
+
return await HMSManager.getAudioMixingMode({
|
|
615
|
+
id: this.id
|
|
616
|
+
});
|
|
617
|
+
} else {
|
|
618
|
+
console.log('API currently not available for iOS');
|
|
619
|
+
return 'API currently not available for iOS';
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
_defineProperty(this, "setAudioMixingMode", async audioMixingMode => {
|
|
624
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setAudioMixingMode', {
|
|
625
|
+
id: this.id,
|
|
626
|
+
audioMixingMode
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
630
|
+
return await HMSManager.setAudioMixingMode({
|
|
631
|
+
id: this.id,
|
|
632
|
+
audioMixingMode
|
|
633
|
+
});
|
|
634
|
+
} else {
|
|
635
|
+
console.log('API currently not available for iOS');
|
|
636
|
+
return 'API currently not available for iOS';
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
_defineProperty(this, "getAudioDevicesList", async () => {
|
|
641
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getAudioDevicesList', {
|
|
642
|
+
id: this.id
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
646
|
+
return await HMSManager.getAudioDevicesList({
|
|
560
647
|
id: this.id
|
|
561
648
|
});
|
|
562
649
|
} else {
|
|
563
|
-
console.log('API currently not
|
|
650
|
+
console.log('API currently not available for iOS');
|
|
651
|
+
return 'API currently not available for iOS';
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
_defineProperty(this, "getAudioOutputRouteType", async () => {
|
|
656
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getAudioOutputRouteType', {
|
|
657
|
+
id: this.id
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
661
|
+
return await HMSManager.getAudioOutputRouteType({
|
|
662
|
+
id: this.id
|
|
663
|
+
});
|
|
664
|
+
} else {
|
|
665
|
+
console.log('API currently not available for iOS');
|
|
666
|
+
return 'API currently not available for iOS';
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
_defineProperty(this, "switchAudioOutput", audioDevice => {
|
|
671
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function switchAudioOutput', {
|
|
672
|
+
id: this.id,
|
|
673
|
+
audioDevice
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
677
|
+
return HMSManager.switchAudioOutput({
|
|
678
|
+
id: this.id,
|
|
679
|
+
audioDevice
|
|
680
|
+
});
|
|
681
|
+
} else {
|
|
682
|
+
console.log('API currently not available for iOS');
|
|
683
|
+
return 'API currently not available for iOS';
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
_defineProperty(this, "setAudioMode", audioMode => {
|
|
688
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setAudioMode', {
|
|
689
|
+
id: this.id,
|
|
690
|
+
audioMode
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
694
|
+
return HMSManager.setAudioMode({
|
|
695
|
+
id: this.id,
|
|
696
|
+
audioMode
|
|
697
|
+
});
|
|
698
|
+
} else {
|
|
699
|
+
console.log('API currently not available for iOS');
|
|
700
|
+
return 'API currently not available for iOS';
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
_defineProperty(this, "setAudioDeviceChangeListener", callback => {
|
|
705
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setAudioDeviceChangeListener', {
|
|
706
|
+
id: this.id
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
710
|
+
this.addEventListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED, callback);
|
|
711
|
+
return HMSManager.setAudioDeviceChangeListener({
|
|
712
|
+
id: this.id
|
|
713
|
+
});
|
|
714
|
+
} else {
|
|
715
|
+
console.log('API currently not available for iOS');
|
|
716
|
+
return 'API currently not available for iOS';
|
|
564
717
|
}
|
|
565
718
|
});
|
|
566
719
|
|
|
@@ -643,6 +796,10 @@ class HMSSDK {
|
|
|
643
796
|
this.onRemoteVideoStatsDelegate = callback;
|
|
644
797
|
break;
|
|
645
798
|
|
|
799
|
+
case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED:
|
|
800
|
+
this.onAudioDeviceChangedDelegate = callback;
|
|
801
|
+
break;
|
|
802
|
+
|
|
646
803
|
default:
|
|
647
804
|
}
|
|
648
805
|
});
|
|
@@ -726,6 +883,10 @@ class HMSSDK {
|
|
|
726
883
|
this.onRemoteVideoStatsDelegate = null;
|
|
727
884
|
break;
|
|
728
885
|
|
|
886
|
+
case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED:
|
|
887
|
+
this.onAudioDeviceChangedDelegate = null;
|
|
888
|
+
break;
|
|
889
|
+
|
|
729
890
|
default:
|
|
730
891
|
}
|
|
731
892
|
});
|
|
@@ -960,7 +1121,7 @@ class HMSSDK {
|
|
|
960
1121
|
if (this.onErrorDelegate) {
|
|
961
1122
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_ERROR_LISTENER_CALL', data);
|
|
962
1123
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.warn('#Listener ON_ERROR_LISTENER_CALL', data);
|
|
963
|
-
this.onErrorDelegate(data);
|
|
1124
|
+
this.onErrorDelegate(_HMSEncoder.HMSEncoder.encodeHMSException(data));
|
|
964
1125
|
} else {
|
|
965
1126
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.warn('#Listener ON_ERROR', data);
|
|
966
1127
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_ERROR', data);
|
|
@@ -1182,6 +1343,20 @@ class HMSSDK {
|
|
|
1182
1343
|
}
|
|
1183
1344
|
});
|
|
1184
1345
|
|
|
1346
|
+
_defineProperty(this, "onAudioDeviceChangedListener", data => {
|
|
1347
|
+
if (data.id !== this.id) {
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
if (this.onAudioDeviceChangedDelegate) {
|
|
1352
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onAudioDeviceChangedListener_CALL', data);
|
|
1353
|
+
this.onAudioDeviceChangedDelegate({ ...data
|
|
1354
|
+
});
|
|
1355
|
+
} else {
|
|
1356
|
+
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onAudioDeviceChangedListener', data);
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
|
|
1185
1360
|
this.id = id;
|
|
1186
1361
|
}
|
|
1187
1362
|
/**
|