@daily-co/react-native-daily-js 0.39.0 → 0.41.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daily-co/react-native-daily-js",
3
- "version": "0.39.0",
3
+ "version": "0.41.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",
@@ -26,7 +26,7 @@
26
26
  "baseUrl": "https://github.com/daily-co/react-native-daily-js"
27
27
  },
28
28
  "dependencies": {
29
- "@daily-co/daily-js": "^0.41.0",
29
+ "@daily-co/daily-js": "^0.43.0",
30
30
  "@types/react-native-background-timer": "^2.0.0",
31
31
  "react-native-url-polyfill": "^1.1.2"
32
32
  },
@@ -61,6 +61,7 @@ export type DailyEvent =
61
61
  | 'active-speaker-change'
62
62
  | 'network-quality-change'
63
63
  | 'network-connection'
64
+ | 'cpu-load-change'
64
65
  | 'error'
65
66
  | 'nonfatal-error'
66
67
  | 'live-streaming-started'
@@ -105,7 +106,8 @@ export type DailyFatalErrorType =
105
106
  | 'exp-token'
106
107
  | 'meeting-full'
107
108
  | 'end-of-life'
108
- | 'not-allowed';
109
+ | 'not-allowed'
110
+ | 'connection-error';
109
111
 
110
112
  export type DailyNonFatalErrorType =
111
113
  | 'remote-media-player-error'
@@ -333,6 +335,35 @@ export interface DailyNetworkStats {
333
335
  threshold: 'good' | 'low' | 'very-low';
334
336
  }
335
337
 
338
+ export interface DailyCpuLoadStats {
339
+ cpuLoadState: 'low' | 'high';
340
+ cpuLoadStateReason: 'encode' | 'decode' | 'scheduleDuration' | 'none'; // We are currently not using the Inter frame Delay to change the cpu load state
341
+ stats: {
342
+ latest: {
343
+ timestamp: number;
344
+ scheduleDuration: number;
345
+ frameEncodeTimeSec: number;
346
+ targetEncodeFrameRate: number;
347
+ targetDecodeFrameRate: number;
348
+ targetScheduleDuration: number;
349
+ cpuUsageBasedOnTargetEncode: number;
350
+ cpuUsageBasedOnGlobalDecode: number;
351
+ avgFrameDecodeTimeSec: number;
352
+ avgInterFrameDelayStandardDeviation: number;
353
+ totalReceivedVideoTracks: number;
354
+ cpuInboundVideoStats: {
355
+ trackId: string;
356
+ ssrc: number;
357
+ frameWidth: number;
358
+ frameHeight: number;
359
+ fps: number;
360
+ frameDecodeTimeSec: number;
361
+ interFrameDelayStandardDeviation: number;
362
+ }[];
363
+ };
364
+ };
365
+ }
366
+
336
367
  export interface DailyPendingRoomInfo {
337
368
  roomUrlPendingJoin: string;
338
369
  }
@@ -458,23 +489,22 @@ export interface DailyEventObjectNoPayload {
458
489
 
459
490
  export type DailyCameraError = {
460
491
  msg: string;
461
- localizedMsg?: string;
462
492
  };
463
493
 
464
494
  export interface DailyCamPermissionsError extends DailyCameraError {
465
495
  type: Extract<DailyCameraErrorType, 'permissions'>;
466
496
  blockedBy: 'user' | 'browser';
467
- blockedMedia: Set<'video' | 'audio'>;
497
+ blockedMedia: Array<'video' | 'audio'>;
468
498
  }
469
499
 
470
500
  export interface DailyCamDeviceNotFoundError extends DailyCameraError {
471
501
  type: Extract<DailyCameraErrorType, 'not-found'>;
472
- missingMedia: Set<'video' | 'audio'>;
502
+ missingMedia: Array<'video' | 'audio'>;
473
503
  }
474
504
 
475
505
  export interface DailyCamConstraintsError extends DailyCameraError {
476
506
  type: Extract<DailyCameraErrorType, 'constraints'>;
477
- reason: Set<'invalid' | 'none-specified'>;
507
+ reason: 'invalid' | 'none-specified';
478
508
  }
479
509
 
480
510
  export interface DailyCamInUseError extends DailyCameraError {
@@ -492,7 +522,7 @@ export interface DailyCamUnknownError extends DailyCameraError {
492
522
  type: Extract<DailyCameraErrorType, 'unknown'>;
493
523
  }
494
524
 
495
- export type DailyCameraErrorObject<T extends DailyCameraError = any> =
525
+ export type DailyCameraErrorObject<T extends DailyCameraErrorType> =
496
526
  T extends DailyCamPermissionsError['type']
497
527
  ? DailyCamPermissionsError
498
528
  : T extends DailyCamDeviceNotFoundError['type']
@@ -514,16 +544,30 @@ export interface DailyEventObjectCameraError {
514
544
  audioOk?: boolean;
515
545
  videoOk?: boolean;
516
546
  };
517
- error: DailyCameraErrorObject;
547
+ error: DailyCameraErrorObject<DailyCameraErrorType>;
518
548
  }
519
549
 
550
+ export type DailyFatalError = {
551
+ type: DailyFatalErrorType;
552
+ msg: string;
553
+ };
554
+
555
+ export interface DailyFatalConnectionError extends DailyFatalError {
556
+ type: Extract<DailyFatalErrorType, 'connection-error'>;
557
+ details: {
558
+ on: 'join' | 'reconnect';
559
+ sourceError: Error;
560
+ uri?: string;
561
+ };
562
+ }
563
+
564
+ export type DailyFatalErrorObject<T extends DailyFatalErrorType> =
565
+ T extends DailyFatalConnectionError['type'] ? DailyFatalConnectionError : any;
566
+
520
567
  export interface DailyEventObjectFatalError {
521
568
  action: Extract<DailyEvent, 'error'>;
522
569
  errorMsg: string;
523
- error?: {
524
- type: DailyFatalErrorType;
525
- localizedMsg?: string;
526
- };
570
+ error?: DailyFatalErrorObject<DailyFatalErrorType>;
527
571
  }
528
572
 
529
573
  export interface DailyEventObjectNonFatalError {
@@ -632,6 +676,12 @@ export interface DailyEventObjectNetworkQualityEvent {
632
676
  quality: number;
633
677
  }
634
678
 
679
+ export interface DailyEventObjectCpuLoadEvent {
680
+ action: Extract<DailyEvent, 'cpu-load-change'>;
681
+ cpuLoadState: 'low' | 'high';
682
+ cpuLoadStateReason: 'encode' | 'decode' | 'scheduleDuration' | 'none'; // We are currently not using the Inter frame Delay to change the cpu load state
683
+ }
684
+
635
685
  export type DailyNetworkConnectionType = 'signaling' | 'peer-to-peer' | 'sfu';
636
686
 
637
687
  export interface DailyEventObjectNetworkConnectionEvent {
@@ -760,6 +810,8 @@ export type DailyEventObject<T extends DailyEvent = any> =
760
810
  ? DailyEventObjectRemoteMediaPlayerStopped
761
811
  : T extends DailyEventObjectNetworkQualityEvent['action']
762
812
  ? DailyEventObjectNetworkQualityEvent
813
+ : T extends DailyEventObjectCpuLoadEvent['action']
814
+ ? DailyEventObjectCpuLoadEvent
763
815
  : T extends DailyEventObjectNetworkConnectionEvent['action']
764
816
  ? DailyEventObjectNetworkConnectionEvent
765
817
  : T extends DailyEventObjectActiveSpeakerChange['action']
@@ -807,7 +859,7 @@ export interface DailyStreamingPortraitLayoutConfig {
807
859
 
808
860
  export interface DailyStreamingCustomLayoutConfig {
809
861
  preset: 'custom';
810
- composition_id: string;
862
+ composition_id?: string;
811
863
  composition_params?: {
812
864
  [key: string]: boolean | number | string;
813
865
  };
@@ -1004,6 +1056,7 @@ export interface DailyCall {
1004
1056
  }): void;
1005
1057
  stopRecording(options?: { instanceId: string }): void;
1006
1058
  getNetworkStats(): Promise<DailyNetworkStats>;
1059
+ getCpuLoadStats(): Promise<DailyCpuLoadStats>;
1007
1060
  subscribeToTracksAutomatically(): boolean;
1008
1061
  setSubscribeToTracksAutomatically(enabled: boolean): DailyCall;
1009
1062
  enumerateDevices(): Promise<{ devices: MediaDeviceInfo[] }>;