@daily-co/react-native-daily-js 0.36.0 → 0.39.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/README.md +3 -1
- package/dist/DailyMediaView.d.ts +1 -1
- package/dist/DailyMediaView.js +10 -6
- package/dist/iOSCallObjectBundleCache.d.ts +1 -1
- package/dist/iOSCallObjectBundleCache.js +3 -3
- package/dist/index.js +7 -3
- package/package.json +5 -5
- package/type-overrides/@daily-co/daily-js/index.d.ts +41 -3
package/README.md
CHANGED
|
@@ -15,11 +15,13 @@ Install `react-native-daily-js` along with its peer dependencies:
|
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
npm i @daily-co/react-native-daily-js @react-native-async-storage/async-storage@^1.15.7 react-native-background-timer@^2.3.1
|
|
18
|
-
npm i --save-exact @daily-co/react-native-webrtc@
|
|
18
|
+
npm i --save-exact @daily-co/react-native-webrtc@106.0.6-daily.1
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Then, follow the below steps to set up your native project on each platform. **Note that these steps assume you're using a version of React Native that supports autolinking (>= 60).**
|
|
22
22
|
|
|
23
|
+
> If your project uses [Expo](https://expo.dev/), use the [`config-plugin-rn-daily-js` configuration package](https://www.npmjs.com/package/@daily-co/config-plugin-rn-daily-js) instead of the following steps.
|
|
24
|
+
|
|
23
25
|
### iOS
|
|
24
26
|
|
|
25
27
|
Update the `platform` in your `Podfile`, since `@daily-co/react-native-webrtc` only works on iOS 11 and above:
|
package/dist/DailyMediaView.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
3
|
import { MediaStreamTrack, RTCViewProps } from '@daily-co/react-native-webrtc';
|
|
4
|
-
|
|
4
|
+
type Props = {
|
|
5
5
|
videoTrack: MediaStreamTrack | null;
|
|
6
6
|
audioTrack: MediaStreamTrack | null;
|
|
7
7
|
mirror?: RTCViewProps['mirror'];
|
package/dist/DailyMediaView.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -14,7 +18,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
18
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
19
|
if (mod && mod.__esModule) return mod;
|
|
16
20
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
22
|
__setModuleDefault(result, mod);
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
@@ -24,8 +28,8 @@ var react_1 = require("react");
|
|
|
24
28
|
var react_native_1 = require("react-native");
|
|
25
29
|
var react_native_webrtc_1 = require("@daily-co/react-native-webrtc");
|
|
26
30
|
function DailyMediaView(props) {
|
|
27
|
-
var _a = react_1.useState(null), stream = _a[0], setStream = _a[1];
|
|
28
|
-
react_1.useEffect(function () {
|
|
31
|
+
var _a = (0, react_1.useState)(null), stream = _a[0], setStream = _a[1];
|
|
32
|
+
(0, react_1.useEffect)(function () {
|
|
29
33
|
var tracks = [props.videoTrack, props.audioTrack].filter(function (t) { return t; });
|
|
30
34
|
var stream = tracks.length > 0 ? new react_native_webrtc_1.MediaStream(tracks) : null;
|
|
31
35
|
setStream(stream);
|
|
@@ -37,8 +41,8 @@ function DailyMediaView(props) {
|
|
|
37
41
|
// and in fact triggers a bug where if it's hidden while in the background
|
|
38
42
|
// it gets "stuck" in the hidden state.
|
|
39
43
|
style={props.videoTrack || react_native_1.Platform.OS === 'android'
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
? props.style
|
|
45
|
+
: { display: 'none' }}/>) : null;
|
|
42
46
|
// provide empty placeholder when no video is playing, to try to avoid
|
|
43
47
|
// messing with any layout that depends on this DailyMediaView's style
|
|
44
48
|
var placeholderView = props.videoTrack ? null : (<react_native_1.View style={props.style}/>);
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -47,7 +47,7 @@ var FIELD_BUNDLE_ETAG = 'etag';
|
|
|
47
47
|
var REQUIRED_FIELDS = [FIELD_BUNDLE_CODE, FIELD_CACHE_EXPIRY];
|
|
48
48
|
var DEFAULT_EXPIRY_MS = 60 * 1000;
|
|
49
49
|
function cacheKeyForUrl(url) {
|
|
50
|
-
return "callobj_bundle_"
|
|
50
|
+
return "callobj_bundle_".concat(url);
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* A workaround for the fact that the iOS HTTP cache won't cache the call
|
|
@@ -79,7 +79,7 @@ var iOSCallObjectBundleCache = /** @class */ (function () {
|
|
|
79
79
|
for (_i = 0, REQUIRED_FIELDS_1 = REQUIRED_FIELDS; _i < REQUIRED_FIELDS_1.length; _i++) {
|
|
80
80
|
field = REQUIRED_FIELDS_1[_i];
|
|
81
81
|
if (!cacheItem[field]) {
|
|
82
|
-
throw new Error("Missing call object bundle cache item field: "
|
|
82
|
+
throw new Error("Missing call object bundle cache item field: ".concat(field));
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
// If cache expired, return headers needed to conditionally fetch the
|
package/dist/index.js
CHANGED
|
@@ -12,13 +12,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
19
23
|
}));
|
|
20
24
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
-
for (var p in m) if (p !== "default" && !
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
26
|
};
|
|
23
27
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
24
28
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -70,7 +74,7 @@ function setupEventListeners() {
|
|
|
70
74
|
}
|
|
71
75
|
function setupGlobals() {
|
|
72
76
|
// WebRTC APIs + global `window` object
|
|
73
|
-
react_native_webrtc_1.registerGlobals();
|
|
77
|
+
(0, react_native_webrtc_1.registerGlobals)();
|
|
74
78
|
// A shim to prevent errors in call machine bundle (not ideal)
|
|
75
79
|
global.window.addEventListener = function () { };
|
|
76
80
|
// A workaround for iOS HTTP cache not caching call object bundle due to size
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daily-co/react-native-daily-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.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,19 +26,19 @@
|
|
|
26
26
|
"baseUrl": "https://github.com/daily-co/react-native-daily-js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@daily-co/daily-js": "^0.
|
|
29
|
+
"@daily-co/daily-js": "^0.41.0",
|
|
30
30
|
"@types/react-native-background-timer": "^2.0.0",
|
|
31
31
|
"react-native-url-polyfill": "^1.1.2"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@daily-co/react-native-webrtc": "
|
|
34
|
+
"@daily-co/react-native-webrtc": "^106.0.6-daily.1",
|
|
35
35
|
"@react-native-async-storage/async-storage": "^1.15.7",
|
|
36
36
|
"react-native-background-timer": "^2.3.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@daily-co/react-native-webrtc": "
|
|
39
|
+
"@daily-co/react-native-webrtc": "^106.0.6-daily.1",
|
|
40
40
|
"@react-native-async-storage/async-storage": "^1.15.7",
|
|
41
41
|
"react-native-background-timer": "^2.3.1",
|
|
42
|
-
"typescript": "^
|
|
42
|
+
"typescript": "^4.8.4"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -64,6 +64,7 @@ export type DailyEvent =
|
|
|
64
64
|
| 'error'
|
|
65
65
|
| 'nonfatal-error'
|
|
66
66
|
| 'live-streaming-started'
|
|
67
|
+
| 'live-streaming-updated'
|
|
67
68
|
| 'live-streaming-stopped'
|
|
68
69
|
| 'live-streaming-error'
|
|
69
70
|
| 'remote-media-player-started'
|
|
@@ -124,6 +125,7 @@ export interface DailyBrowserInfo {
|
|
|
124
125
|
supportsScreenShare: boolean;
|
|
125
126
|
supportsSfu: boolean;
|
|
126
127
|
supportsVideoProcessing: boolean;
|
|
128
|
+
supportsAudioProcessing: boolean;
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
export interface DailyCallOptions {
|
|
@@ -145,6 +147,10 @@ export interface DailyLoadOptions extends DailyCallOptions {
|
|
|
145
147
|
baseUrl?: string;
|
|
146
148
|
}
|
|
147
149
|
|
|
150
|
+
export interface DailyFactoryOptions extends DailyCallOptions {
|
|
151
|
+
strictMode?: boolean; // only available at constructor time
|
|
152
|
+
}
|
|
153
|
+
|
|
148
154
|
export interface CamSimulcastEncoding {
|
|
149
155
|
maxBitrate: number;
|
|
150
156
|
maxFramerate?: number;
|
|
@@ -266,7 +272,9 @@ export interface DailyWaitingParticipant {
|
|
|
266
272
|
|
|
267
273
|
export type DailyTrackSubscriptionState = 'staged' | boolean;
|
|
268
274
|
|
|
269
|
-
export type DailyCustomTrackSubscriptionState =
|
|
275
|
+
export type DailyCustomTrackSubscriptionState =
|
|
276
|
+
| DailyTrackSubscriptionState
|
|
277
|
+
| { [name: string]: DailyTrackSubscriptionState };
|
|
270
278
|
|
|
271
279
|
export type DailyTrackSubscriptionOptions =
|
|
272
280
|
| DailyTrackSubscriptionState
|
|
@@ -342,6 +350,7 @@ export interface DailyRoomInfo {
|
|
|
342
350
|
enable_chat?: boolean;
|
|
343
351
|
enable_knocking?: boolean;
|
|
344
352
|
enable_network_ui?: boolean;
|
|
353
|
+
enable_noise_cancellation_ui?: boolean;
|
|
345
354
|
enable_people_ui?: boolean;
|
|
346
355
|
enable_pip_ui?: boolean;
|
|
347
356
|
enable_hand_raising?: boolean;
|
|
@@ -376,6 +385,7 @@ export interface DailyRoomInfo {
|
|
|
376
385
|
enable_breakout_rooms?: boolean;
|
|
377
386
|
enable_emoji_reactions?: boolean;
|
|
378
387
|
enable_network_ui?: boolean;
|
|
388
|
+
enable_noise_cancellation_ui?: boolean;
|
|
379
389
|
enable_people_ui?: boolean;
|
|
380
390
|
enable_pip_ui?: boolean;
|
|
381
391
|
enable_hand_raising?: boolean;
|
|
@@ -584,6 +594,14 @@ export interface DailyEventObjectTrack {
|
|
|
584
594
|
action: Extract<DailyEvent, 'track-started' | 'track-stopped'>;
|
|
585
595
|
participant: DailyParticipant | null; // null if participant left meeting
|
|
586
596
|
track: MediaStreamTrack;
|
|
597
|
+
type:
|
|
598
|
+
| 'video'
|
|
599
|
+
| 'audio'
|
|
600
|
+
| 'screenVideo'
|
|
601
|
+
| 'screenAudio'
|
|
602
|
+
| 'rmpVideo'
|
|
603
|
+
| 'rmpAudio'
|
|
604
|
+
| string; // string - for custom tracks
|
|
587
605
|
}
|
|
588
606
|
|
|
589
607
|
export interface DailyEventObjectRecordingStarted {
|
|
@@ -652,6 +670,12 @@ export interface DailyEventObjectLiveStreamingStarted {
|
|
|
652
670
|
layout?: DailyStreamingLayoutConfig;
|
|
653
671
|
instanceId?: string;
|
|
654
672
|
}
|
|
673
|
+
export interface DailyEventObjectLiveStreamingUpdated {
|
|
674
|
+
action: Extract<DailyEvent, 'live-streaming-updated'>;
|
|
675
|
+
endpoint?: DailyStreamingEndpoint;
|
|
676
|
+
state: DailyStreamingState;
|
|
677
|
+
instanceId?: string;
|
|
678
|
+
}
|
|
655
679
|
|
|
656
680
|
export interface DailyEventObjectLiveStreamingStopped {
|
|
657
681
|
action: Extract<DailyEvent, 'live-streaming-stopped'>;
|
|
@@ -702,6 +726,12 @@ export type DailyEventObject<T extends DailyEvent = any> =
|
|
|
702
726
|
? DailyEventObjectGenericError
|
|
703
727
|
: T extends DailyEventObjectParticipants['action']
|
|
704
728
|
? DailyEventObjectParticipants
|
|
729
|
+
: T extends DailyEventObjectLiveStreamingStarted['action']
|
|
730
|
+
? DailyEventObjectLiveStreamingStarted
|
|
731
|
+
: T extends DailyEventObjectLiveStreamingUpdated['action']
|
|
732
|
+
? DailyEventObjectLiveStreamingUpdated
|
|
733
|
+
: T extends DailyEventObjectLiveStreamingStopped['action']
|
|
734
|
+
? DailyEventObjectLiveStreamingStopped
|
|
705
735
|
: T extends DailyEventObjectLiveStreamingError['action']
|
|
706
736
|
? DailyEventObjectLiveStreamingError
|
|
707
737
|
: T extends DailyEventObjectParticipant['action']
|
|
@@ -720,6 +750,10 @@ export type DailyEventObject<T extends DailyEvent = any> =
|
|
|
720
750
|
? DailyEventObjectTrack
|
|
721
751
|
: T extends DailyEventObjectRecordingStarted['action']
|
|
722
752
|
? DailyEventObjectRecordingStarted
|
|
753
|
+
: T extends DailyEventObjectRecordingStopped['action']
|
|
754
|
+
? DailyEventObjectRecordingStopped
|
|
755
|
+
: T extends DailyEventObjectRecordingError['action']
|
|
756
|
+
? DailyEventObjectRecordingError
|
|
723
757
|
: T extends DailyEventObjectRemoteMediaPlayerUpdate['action']
|
|
724
758
|
? DailyEventObjectRemoteMediaPlayerUpdate
|
|
725
759
|
: T extends DailyEventObjectRemoteMediaPlayerStopped['action']
|
|
@@ -739,7 +773,8 @@ export type DailyEventObject<T extends DailyEvent = any> =
|
|
|
739
773
|
export type DailyNativeInCallAudioMode = 'video' | 'voice';
|
|
740
774
|
|
|
741
775
|
export interface DailyCallFactory {
|
|
742
|
-
createCallObject(properties?:
|
|
776
|
+
createCallObject(properties?: DailyFactoryOptions): DailyCall;
|
|
777
|
+
getCallInstance(): DailyCall;
|
|
743
778
|
}
|
|
744
779
|
|
|
745
780
|
export interface DailyCallStaticUtils {
|
|
@@ -788,6 +823,8 @@ export type DailyStreamingLayoutConfig =
|
|
|
788
823
|
| DailyStreamingPortraitLayoutConfig
|
|
789
824
|
| DailyStreamingCustomLayoutConfig;
|
|
790
825
|
|
|
826
|
+
export type DailyStreamingState = 'connected' | 'interrupted';
|
|
827
|
+
|
|
791
828
|
export type DailyRemoteMediaPlayerSettingPlay = 'play';
|
|
792
829
|
export type DailyRemoteMediaPlayerSettingPause = 'pause';
|
|
793
830
|
|
|
@@ -877,13 +914,14 @@ export interface DailyTranscriptionDeepgramOptions {
|
|
|
877
914
|
model?: string;
|
|
878
915
|
tier?: string;
|
|
879
916
|
profanity_filter?: boolean;
|
|
880
|
-
redact?: boolean;
|
|
917
|
+
redact?: Array<string> | boolean;
|
|
881
918
|
}
|
|
882
919
|
|
|
883
920
|
export interface DailyCall {
|
|
884
921
|
join(properties?: DailyCallOptions): Promise<DailyParticipantsObject | void>;
|
|
885
922
|
leave(): Promise<void>;
|
|
886
923
|
destroy(): Promise<void>;
|
|
924
|
+
isDestroyed(): boolean;
|
|
887
925
|
meetingState(): DailyMeetingState;
|
|
888
926
|
accessState(): DailyAccessState;
|
|
889
927
|
participants(): DailyParticipantsObject;
|