@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
package/src/classes/HMSSDK.tsx
CHANGED
|
@@ -28,6 +28,9 @@ import type { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
|
28
28
|
import type { HMSTrackSettings } from './HMSTrackSettings';
|
|
29
29
|
import type { HMSRTMPConfig } from './HMSRTMPConfig';
|
|
30
30
|
import type { HMSHLSConfig } from './HMSHLSConfig';
|
|
31
|
+
import type { HMSAudioDevice } from './HMSAudioDevice';
|
|
32
|
+
import type { HMSAudioMode } from './HMSAudioMode';
|
|
33
|
+
import type { HMSAudioMixingMode } from './HMSAudioMixingMode';
|
|
31
34
|
|
|
32
35
|
interface HmsViewProps {
|
|
33
36
|
trackId: string;
|
|
@@ -75,6 +78,7 @@ export class HMSSDK {
|
|
|
75
78
|
onLocalVideoStatsDelegate?: any;
|
|
76
79
|
onRemoteAudioStatsDelegate?: any;
|
|
77
80
|
onRemoteVideoStatsDelegate?: any;
|
|
81
|
+
onAudioDeviceChangedDelegate?: any;
|
|
78
82
|
|
|
79
83
|
constructor(id: string) {
|
|
80
84
|
this.id = id;
|
|
@@ -228,6 +232,11 @@ export class HMSSDK {
|
|
|
228
232
|
HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS,
|
|
229
233
|
this.onRemoteVideoStatsListener
|
|
230
234
|
);
|
|
235
|
+
|
|
236
|
+
HmsEventEmitter.addListener(
|
|
237
|
+
HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED,
|
|
238
|
+
this.onAudioDeviceChangedListener
|
|
239
|
+
);
|
|
231
240
|
};
|
|
232
241
|
|
|
233
242
|
/**
|
|
@@ -320,6 +329,11 @@ export class HMSSDK {
|
|
|
320
329
|
HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS,
|
|
321
330
|
this.onRemoteVideoStatsListener
|
|
322
331
|
);
|
|
332
|
+
|
|
333
|
+
HmsEventEmitter.removeListener(
|
|
334
|
+
HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED,
|
|
335
|
+
this.onAudioDeviceChangedListener
|
|
336
|
+
);
|
|
323
337
|
};
|
|
324
338
|
|
|
325
339
|
/**
|
|
@@ -376,13 +390,14 @@ export class HMSSDK {
|
|
|
376
390
|
};
|
|
377
391
|
|
|
378
392
|
/**
|
|
379
|
-
* - HmsView is react component that takes
|
|
393
|
+
* - HmsView is react component that takes trackId and starts showing that track on a tile.
|
|
380
394
|
* - The appearance of tile is completely customizable with style prop.
|
|
381
|
-
* -
|
|
395
|
+
* - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
|
|
396
|
+
* - Mirror to flip the video vertically.
|
|
382
397
|
*
|
|
383
398
|
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
|
|
384
399
|
*
|
|
385
|
-
* @param {
|
|
400
|
+
* @param {HmsViewProps}
|
|
386
401
|
* @memberof HMSSDK
|
|
387
402
|
*/
|
|
388
403
|
HmsView = React.forwardRef<any, HmsViewProps>((props, ref) => {
|
|
@@ -557,7 +572,7 @@ export class HMSSDK {
|
|
|
557
572
|
* @param {HMSHLSConfig}
|
|
558
573
|
* @memberof HMSSDK
|
|
559
574
|
*/
|
|
560
|
-
startHLSStreaming = async (data
|
|
575
|
+
startHLSStreaming = async (data?: HMSHLSConfig) => {
|
|
561
576
|
logger?.verbose('#Function startHLSStreaming', {
|
|
562
577
|
...data,
|
|
563
578
|
id: this.id,
|
|
@@ -605,7 +620,7 @@ export class HMSSDK {
|
|
|
605
620
|
|
|
606
621
|
/**
|
|
607
622
|
* - This function can be used to manipulate mute status of any track.
|
|
608
|
-
* - Targeted peer affected by this action will get a callback in
|
|
623
|
+
* - Targeted peer affected by this action will get a callback in onChangeTrackStateRequestListener.
|
|
609
624
|
*
|
|
610
625
|
* * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-track-state} for more info
|
|
611
626
|
*
|
|
@@ -631,7 +646,7 @@ export class HMSSDK {
|
|
|
631
646
|
* - changeTrackStateForRoles is an enhancement on the functionality of {@link changeTrackState}.
|
|
632
647
|
* - We can change mute status for all the tracks of peers having a particular role.
|
|
633
648
|
* - @param source determines the source of the track ex. video, audio etc.
|
|
634
|
-
* - The peers affected by this action will get a callback in
|
|
649
|
+
* - The peers affected by this action will get a callback in onChangeTrackStateRequestListener.
|
|
635
650
|
*
|
|
636
651
|
* @memberof HMSSDK
|
|
637
652
|
*/
|
|
@@ -736,7 +751,7 @@ export class HMSSDK {
|
|
|
736
751
|
};
|
|
737
752
|
|
|
738
753
|
/**
|
|
739
|
-
* - setPlaybackForAllAudio is an extension of the abilities of
|
|
754
|
+
* - setPlaybackForAllAudio is an extension of the abilities of setPlaybackAllowed in
|
|
740
755
|
* {@link HMSRemoteAudioTrack}, it sets mute status for all peers in the room
|
|
741
756
|
*
|
|
742
757
|
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/playback-allowed} for more info
|
|
@@ -888,11 +903,7 @@ export class HMSSDK {
|
|
|
888
903
|
*/
|
|
889
904
|
enableRTCStats = () => {
|
|
890
905
|
logger?.verbose('#Function enableRTCStats', { id: this.id });
|
|
891
|
-
|
|
892
|
-
HMSManager.enableRTCStats({ id: this.id });
|
|
893
|
-
} else {
|
|
894
|
-
console.log('API currently not avaialble for android');
|
|
895
|
-
}
|
|
906
|
+
HMSManager.enableRTCStats({ id: this.id });
|
|
896
907
|
};
|
|
897
908
|
|
|
898
909
|
/**
|
|
@@ -905,10 +916,209 @@ export class HMSSDK {
|
|
|
905
916
|
*/
|
|
906
917
|
disableRTCStats = () => {
|
|
907
918
|
logger?.verbose('#Function disableRTCStats', { id: this.id });
|
|
908
|
-
|
|
909
|
-
|
|
919
|
+
HMSManager.disableRTCStats({ id: this.id });
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* - This wrapper function is used to start streaming device audio, currently available only for android.
|
|
924
|
+
*
|
|
925
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stream-device-audio-from-the-app} for more info.
|
|
926
|
+
*
|
|
927
|
+
* @param {HMSAudioMixingMode}
|
|
928
|
+
* @memberof HMSSDK
|
|
929
|
+
*/
|
|
930
|
+
startAudioshare = async (audioMixingMode: HMSAudioMixingMode) => {
|
|
931
|
+
logger?.verbose('#Function startAudioshare', {
|
|
932
|
+
id: this.id,
|
|
933
|
+
audioMixingMode,
|
|
934
|
+
});
|
|
935
|
+
if (Platform.OS === 'android') {
|
|
936
|
+
return await HMSManager.startAudioshare({ id: this.id, audioMixingMode });
|
|
937
|
+
} else {
|
|
938
|
+
console.log('API currently not available for iOS');
|
|
939
|
+
return 'API currently not available for iOS';
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* - This wrapper function returns true if audio is being shared and vice versa, currently available only for android.
|
|
945
|
+
*
|
|
946
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-get-audio-share-status} for more info.
|
|
947
|
+
*
|
|
948
|
+
* @memberof HMSSDK
|
|
949
|
+
*/
|
|
950
|
+
isAudioShared = async () => {
|
|
951
|
+
logger?.verbose('#Function isAudioShared', { id: this.id });
|
|
952
|
+
if (Platform.OS === 'android') {
|
|
953
|
+
return await HMSManager.isAudioShared({ id: this.id });
|
|
954
|
+
} else {
|
|
955
|
+
console.log('API currently not available for iOS');
|
|
956
|
+
return 'API currently not available for iOS';
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* - This wrapper function is used to stop streaming device audio, currently available only for android.
|
|
962
|
+
*
|
|
963
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stop-audio-sharing} for more info.
|
|
964
|
+
*
|
|
965
|
+
* @memberof HMSSDK
|
|
966
|
+
*/
|
|
967
|
+
stopAudioshare = async () => {
|
|
968
|
+
logger?.verbose('#Function stopAudioshare', { id: this.id });
|
|
969
|
+
if (Platform.OS === 'android') {
|
|
970
|
+
return await HMSManager.stopAudioshare({ id: this.id });
|
|
971
|
+
} else {
|
|
972
|
+
console.log('API currently not available for iOS');
|
|
973
|
+
return 'API currently not available for iOS';
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* - This wrapper function returns the current audio mixing mode, currently available only for android.
|
|
979
|
+
*
|
|
980
|
+
* @memberof HMSSDK
|
|
981
|
+
* @return HMSAudioMixingMode
|
|
982
|
+
*/
|
|
983
|
+
getAudioMixingMode = async () => {
|
|
984
|
+
logger?.verbose('#Function getAudioMixingMode', { id: this.id });
|
|
985
|
+
if (Platform.OS === 'android') {
|
|
986
|
+
return await HMSManager.getAudioMixingMode({ id: this.id });
|
|
910
987
|
} else {
|
|
911
|
-
console.log('API currently not
|
|
988
|
+
console.log('API currently not available for iOS');
|
|
989
|
+
return 'API currently not available for iOS';
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* - This wrapper function used to change the mode while the user is streaming audio, currently available only for android.
|
|
995
|
+
*
|
|
996
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-change-mode} for more info
|
|
997
|
+
*
|
|
998
|
+
* @param {HMSAudioMixingMode}
|
|
999
|
+
* @memberof HMSSDK
|
|
1000
|
+
*/
|
|
1001
|
+
setAudioMixingMode = async (audioMixingMode: HMSAudioMixingMode) => {
|
|
1002
|
+
logger?.verbose('#Function setAudioMixingMode', {
|
|
1003
|
+
id: this.id,
|
|
1004
|
+
audioMixingMode,
|
|
1005
|
+
});
|
|
1006
|
+
if (Platform.OS === 'android') {
|
|
1007
|
+
return await HMSManager.setAudioMixingMode({
|
|
1008
|
+
id: this.id,
|
|
1009
|
+
audioMixingMode,
|
|
1010
|
+
});
|
|
1011
|
+
} else {
|
|
1012
|
+
console.log('API currently not available for iOS');
|
|
1013
|
+
return 'API currently not available for iOS';
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* - This wrapper function returns the array of audio output devices which is of
|
|
1019
|
+
* type {@link HMSAudioDevice[]}, currently available only for android.
|
|
1020
|
+
*
|
|
1021
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-list-of-audio-device} for more info
|
|
1022
|
+
*
|
|
1023
|
+
* @memberof HMSSDK
|
|
1024
|
+
* @return HMSAudioDevice[]
|
|
1025
|
+
*/
|
|
1026
|
+
getAudioDevicesList = async () => {
|
|
1027
|
+
logger?.verbose('#Function getAudioDevicesList', {
|
|
1028
|
+
id: this.id,
|
|
1029
|
+
});
|
|
1030
|
+
if (Platform.OS === 'android') {
|
|
1031
|
+
return await HMSManager.getAudioDevicesList({ id: this.id });
|
|
1032
|
+
} else {
|
|
1033
|
+
console.log('API currently not available for iOS');
|
|
1034
|
+
return 'API currently not available for iOS';
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* - This wrapper function returns the current audio output device which is of
|
|
1040
|
+
* type {@link HMSAudioDevice}, currently available only for android.
|
|
1041
|
+
*
|
|
1042
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-current-focussed-device} for more info
|
|
1043
|
+
*
|
|
1044
|
+
* @memberof HMSSDK
|
|
1045
|
+
* @return HMSAudioDevice
|
|
1046
|
+
*/
|
|
1047
|
+
getAudioOutputRouteType = async () => {
|
|
1048
|
+
logger?.verbose('#Function getAudioOutputRouteType', {
|
|
1049
|
+
id: this.id,
|
|
1050
|
+
});
|
|
1051
|
+
if (Platform.OS === 'android') {
|
|
1052
|
+
return await HMSManager.getAudioOutputRouteType({ id: this.id });
|
|
1053
|
+
} else {
|
|
1054
|
+
console.log('API currently not available for iOS');
|
|
1055
|
+
return 'API currently not available for iOS';
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* - This wrapper function used to switch output to device other than the default, currently available only for android.
|
|
1061
|
+
*
|
|
1062
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#switch-audio-focus-to-another-device} for more info
|
|
1063
|
+
*
|
|
1064
|
+
* @param {HMSAudioDevice}
|
|
1065
|
+
* @memberof HMSSDK
|
|
1066
|
+
*/
|
|
1067
|
+
switchAudioOutput = (audioDevice: HMSAudioDevice) => {
|
|
1068
|
+
logger?.verbose('#Function switchAudioOutput', {
|
|
1069
|
+
id: this.id,
|
|
1070
|
+
audioDevice,
|
|
1071
|
+
});
|
|
1072
|
+
if (Platform.OS === 'android') {
|
|
1073
|
+
return HMSManager.switchAudioOutput({ id: this.id, audioDevice });
|
|
1074
|
+
} else {
|
|
1075
|
+
console.log('API currently not available for iOS');
|
|
1076
|
+
return 'API currently not available for iOS';
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* - This wrapper function used to change Audio Mode manually, currently available only for android.
|
|
1082
|
+
*
|
|
1083
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-mode-change} for more info
|
|
1084
|
+
*
|
|
1085
|
+
* @param {HMSAudioMode}
|
|
1086
|
+
* @memberof HMSSDK
|
|
1087
|
+
*/
|
|
1088
|
+
setAudioMode = (audioMode: HMSAudioMode) => {
|
|
1089
|
+
logger?.verbose('#Function setAudioMode', {
|
|
1090
|
+
id: this.id,
|
|
1091
|
+
audioMode,
|
|
1092
|
+
});
|
|
1093
|
+
if (Platform.OS === 'android') {
|
|
1094
|
+
return HMSManager.setAudioMode({ id: this.id, audioMode });
|
|
1095
|
+
} else {
|
|
1096
|
+
console.log('API currently not available for iOS');
|
|
1097
|
+
return 'API currently not available for iOS';
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* - This is a wrapper function which adds a listener which is triggered when audio output device is switched, currently available only for android.
|
|
1103
|
+
*
|
|
1104
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#adding-a-listener} for more info
|
|
1105
|
+
*
|
|
1106
|
+
* @param {Function}
|
|
1107
|
+
* @memberof HMSSDK
|
|
1108
|
+
*/
|
|
1109
|
+
setAudioDeviceChangeListener = (callback: Function) => {
|
|
1110
|
+
logger?.verbose('#Function setAudioDeviceChangeListener', {
|
|
1111
|
+
id: this.id,
|
|
1112
|
+
});
|
|
1113
|
+
if (Platform.OS === 'android') {
|
|
1114
|
+
this.addEventListener(
|
|
1115
|
+
HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED,
|
|
1116
|
+
callback
|
|
1117
|
+
);
|
|
1118
|
+
return HMSManager.setAudioDeviceChangeListener({ id: this.id });
|
|
1119
|
+
} else {
|
|
1120
|
+
console.log('API currently not available for iOS');
|
|
1121
|
+
return 'API currently not available for iOS';
|
|
912
1122
|
}
|
|
913
1123
|
};
|
|
914
1124
|
|
|
@@ -979,6 +1189,9 @@ export class HMSSDK {
|
|
|
979
1189
|
case HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS:
|
|
980
1190
|
this.onRemoteVideoStatsDelegate = callback;
|
|
981
1191
|
break;
|
|
1192
|
+
case HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED:
|
|
1193
|
+
this.onAudioDeviceChangedDelegate = callback;
|
|
1194
|
+
break;
|
|
982
1195
|
default:
|
|
983
1196
|
}
|
|
984
1197
|
};
|
|
@@ -1047,6 +1260,9 @@ export class HMSSDK {
|
|
|
1047
1260
|
case HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS:
|
|
1048
1261
|
this.onRemoteVideoStatsDelegate = null;
|
|
1049
1262
|
break;
|
|
1263
|
+
case HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED:
|
|
1264
|
+
this.onAudioDeviceChangedDelegate = null;
|
|
1265
|
+
break;
|
|
1050
1266
|
default:
|
|
1051
1267
|
}
|
|
1052
1268
|
};
|
|
@@ -1290,7 +1506,7 @@ export class HMSSDK {
|
|
|
1290
1506
|
if (this.onErrorDelegate) {
|
|
1291
1507
|
logger?.verbose('#Listener ON_ERROR_LISTENER_CALL', data);
|
|
1292
1508
|
logger?.warn('#Listener ON_ERROR_LISTENER_CALL', data);
|
|
1293
|
-
this.onErrorDelegate(data);
|
|
1509
|
+
this.onErrorDelegate(HMSEncoder.encodeHMSException(data));
|
|
1294
1510
|
} else {
|
|
1295
1511
|
logger?.warn('#Listener ON_ERROR', data);
|
|
1296
1512
|
logger?.verbose('#Listener ON_ERROR', data);
|
|
@@ -1494,4 +1710,22 @@ export class HMSSDK {
|
|
|
1494
1710
|
logger?.verbose('#Listener onRemoteVideoStatsListener', data);
|
|
1495
1711
|
}
|
|
1496
1712
|
};
|
|
1713
|
+
|
|
1714
|
+
onAudioDeviceChangedListener = (data: {
|
|
1715
|
+
id: string;
|
|
1716
|
+
device: string;
|
|
1717
|
+
audioDevicesList: string[];
|
|
1718
|
+
}) => {
|
|
1719
|
+
if (data.id !== this.id) {
|
|
1720
|
+
return;
|
|
1721
|
+
}
|
|
1722
|
+
if (this.onAudioDeviceChangedDelegate) {
|
|
1723
|
+
logger?.verbose('#Listener onAudioDeviceChangedListener_CALL', data);
|
|
1724
|
+
this.onAudioDeviceChangedDelegate({
|
|
1725
|
+
...data,
|
|
1726
|
+
});
|
|
1727
|
+
} else {
|
|
1728
|
+
logger?.verbose('#Listener onAudioDeviceChangedListener', data);
|
|
1729
|
+
}
|
|
1730
|
+
};
|
|
1497
1731
|
}
|
package/src/index.ts
CHANGED
|
@@ -62,6 +62,9 @@ export * from './classes/HMSMessageRecipient';
|
|
|
62
62
|
export * from './classes/HMSMessageRecipientType';
|
|
63
63
|
export * from './classes/HMSNetworkQuality';
|
|
64
64
|
export * from './classes/HMSRtmpVideoResolution';
|
|
65
|
+
export * from './classes/HMSAudioDevice';
|
|
66
|
+
export * from './classes/HMSAudioMode';
|
|
67
|
+
export * from './classes/HMSAudioMixingMode';
|
|
65
68
|
|
|
66
69
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
67
70
|
export default HmsManager;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<component name="libraryTable">
|
|
2
|
-
<library name="Gradle: com.github.100mslive:webrtc:m97@aar">
|
|
3
|
-
<CLASSES>
|
|
4
|
-
<root url="jar://$USER_HOME$/.gradle/caches/transforms-3/1b24a3699ea99c205bdf79a1ecb09294/transformed/webrtc-m97/jars/classes.jar!/" />
|
|
5
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/1b24a3699ea99c205bdf79a1ecb09294/transformed/webrtc-m97/res" />
|
|
6
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/1b24a3699ea99c205bdf79a1ecb09294/transformed/webrtc-m97/AndroidManifest.xml" />
|
|
7
|
-
</CLASSES>
|
|
8
|
-
<JAVADOC />
|
|
9
|
-
<SOURCES />
|
|
10
|
-
</library>
|
|
11
|
-
</component>
|