@daily-co/react-native-daily-js 0.59.0 → 0.61.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.
package/dist/index.js CHANGED
@@ -137,36 +137,8 @@ function setupGlobals() {
137
137
  systemScreenCaptureStartCallback = listener;
138
138
  }, platform: react_native_1.Platform });
139
139
  }
140
- function maybeCreatePromiseAnyPolyfill() {
141
- // Support to Promise.any has only been introduced on RN 0.70.6
142
- // https://github.com/facebook/react-native/releases/tag/v0.70.6
143
- // As spec: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any
144
- // The Promise.any() static method takes an iterable of promises as input and returns a single Promise.
145
- // This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.
146
- // It rejects when all of the input's promises reject (including when an empty iterable is passed)
147
- if (!Promise.any) {
148
- Promise.any = function (promises) {
149
- return new Promise(function (resolve, reject) {
150
- var errors = [];
151
- promises.forEach(function (promise) {
152
- return Promise.resolve(promise)
153
- .then(function (value) {
154
- resolve(value);
155
- })
156
- .catch(function (error) {
157
- errors.push(error);
158
- if (errors.length === promises.length) {
159
- reject(errors);
160
- }
161
- });
162
- });
163
- });
164
- };
165
- }
166
- }
167
140
  setupEventListeners();
168
141
  setupGlobals();
169
- maybeCreatePromiseAnyPolyfill();
170
142
  exports.default = daily_js_1.default;
171
143
  __exportStar(require("@daily-co/daily-js"), exports);
172
144
  __exportStar(require("@daily-co/react-native-webrtc"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daily-co/react-native-daily-js",
3
- "version": "0.59.0",
3
+ "version": "0.61.0",
4
4
  "description": "React Native library for making video calls using Daily",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,20 +28,20 @@
28
28
  "baseUrl": "https://github.com/daily-co/react-native-daily-js"
29
29
  },
30
30
  "dependencies": {
31
- "@daily-co/daily-js": "^0.61.1",
31
+ "@daily-co/daily-js": "^0.63.0",
32
32
  "@types/react-native-background-timer": "^2.0.0",
33
33
  "base-64": "^1.0.0",
34
34
  "react-native-url-polyfill": "^1.1.2"
35
35
  },
36
36
  "///": "WHEN ONE OF THESE CHANGE, PLEASE UPDATE README.md INSTALL SNIPPET ACCORDINGLY",
37
37
  "peerDependencies": {
38
- "@daily-co/react-native-webrtc": "^118.0.3-daily.1",
38
+ "@daily-co/react-native-webrtc": "^118.0.3-daily.2",
39
39
  "@react-native-async-storage/async-storage": "^1.15.7",
40
40
  "react-native-background-timer": "^2.3.1",
41
41
  "react-native-get-random-values": "^1.9.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@daily-co/react-native-webrtc": "^118.0.3-daily.1",
44
+ "@daily-co/react-native-webrtc": "^118.0.3-daily.2",
45
45
  "@react-native-async-storage/async-storage": "^1.15.7",
46
46
  "@types/base-64": "^1.0.0",
47
47
  "react-native-background-timer": "^2.3.1",
@@ -87,6 +87,8 @@ export type DailyEvent =
87
87
  | 'waiting-participant-removed'
88
88
  | 'available-devices-updated'
89
89
  | 'receive-settings-updated'
90
+ | 'local-audio-level'
91
+ | 'remote-participants-audio-level'
90
92
  | 'dialin-connected'
91
93
  | 'dialin-error'
92
94
  | 'dialin-stopped'
@@ -130,6 +132,7 @@ export type DailyFatalErrorType =
130
132
 
131
133
  export type DailyNonFatalErrorType =
132
134
  | 'screen-share-error'
135
+ | 'local-audio-level-observer-error'
133
136
  | 'remote-media-player-error'
134
137
  | 'live-streaming-warning'
135
138
  | 'meeting-session-data-error';
@@ -480,6 +483,7 @@ export interface DailyCpuLoadStats {
480
483
  fps: number;
481
484
  frameDecodeTimeSec: number;
482
485
  interFrameDelayStandardDeviation: number;
486
+ cpuUsageBasedOnTargetDecode: number;
483
487
  }[];
484
488
  };
485
489
  };
@@ -494,6 +498,10 @@ interface DailySendSettings {
494
498
  | undefined;
495
499
  }
496
500
 
501
+ export interface DailyParticipantsAudioLevel {
502
+ [participantId: string]: number;
503
+ }
504
+
497
505
  export type DailyVideoSendSettingsPreset =
498
506
  | 'default'
499
507
  | 'bandwidth-optimized'
@@ -906,6 +914,16 @@ export interface DailyEventObjectSendSettingsUpdated {
906
914
  sendSettings: DailySendSettings;
907
915
  }
908
916
 
917
+ export interface DailyEventObjectLocalAudioLevel {
918
+ action: Extract<DailyEvent, 'local-audio-level'>;
919
+ audioLevel: number;
920
+ }
921
+
922
+ export interface DailyEventObjectRemoteParticipantsAudioLevel {
923
+ action: Extract<DailyEvent, 'remote-participants-audio-level'>;
924
+ participantsAudioLevel: DailyParticipantsAudioLevel;
925
+ }
926
+
909
927
  export interface DailyEventObjectLiveStreamingStarted {
910
928
  action: Extract<DailyEvent, 'live-streaming-started'>;
911
929
  layout?: DailyLiveStreamingLayoutConfig<'start'>;
@@ -1086,6 +1104,10 @@ export type DailyEventObject<T extends DailyEvent = any> =
1086
1104
  ? DailyEventObjectDialOutStopped
1087
1105
  : T extends DailyEventObjectDialOutWarning['action']
1088
1106
  ? DailyEventObjectDialOutWarning
1107
+ : T extends DailyEventObjectLocalAudioLevel['action']
1108
+ ? DailyEventObjectLocalAudioLevel
1109
+ : T extends DailyEventObjectRemoteParticipantsAudioLevel['action']
1110
+ ? DailyEventObjectRemoteParticipantsAudioLevel
1089
1111
  : any;
1090
1112
 
1091
1113
  export type DailyNativeInCallAudioMode = 'video' | 'voice';
@@ -1352,6 +1374,12 @@ export interface DailyCall {
1352
1374
  receiveSettings: DailyReceiveSettingsUpdates
1353
1375
  ): Promise<DailyReceiveSettings>;
1354
1376
  startCamera(properties?: DailyCallOptions): Promise<void>;
1377
+ startLocalAudioLevelObserver(interval?: number): Promise<void>;
1378
+ stopLocalAudioLevelObserver(): void;
1379
+ getLocalAudioLevel(): number;
1380
+ startRemoteParticipantsAudioLevelObserver(interval?: number): Promise<void>;
1381
+ stopRemoteParticipantsAudioLevelObserver(): void;
1382
+ getRemoteParticipantsAudioLevel(): DailyParticipantsAudioLevel;
1355
1383
  cycleCamera(): Promise<{
1356
1384
  device: { facingMode: DailyCameraFacingMode } | null;
1357
1385
  }>;