@daily-co/react-native-daily-js 0.38.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 +1 -1
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
|
}
|
|
@@ -148,7 +148,7 @@ export interface DailyLoadOptions extends DailyCallOptions {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
export interface DailyFactoryOptions extends DailyCallOptions {
|
|
151
|
-
|
|
151
|
+
strictMode?: boolean; // only available at constructor time
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
export interface CamSimulcastEncoding {
|