stream-chat-react-native 4.11.1-beta.4 → 4.12.0-beta.1
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 +2 -2
- package/src/index.js +45 -19
- package/src/optionalDependencies/Video.ts +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native",
|
|
3
3
|
"description": "The official React Native SDK for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.12.0-beta.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"types": "types/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"es6-symbol": "^3.1.3",
|
|
14
|
-
"stream-chat-react-native-core": "4.
|
|
14
|
+
"stream-chat-react-native-core": "4.12.0-beta.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@react-native-community/cameraroll": ">=4.0.1",
|
package/src/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import NetInfo from '@react-native-community/netinfo';
|
|
|
13
13
|
import { FlatList } from '@stream-io/flat-list-mvcp';
|
|
14
14
|
import { registerNativeHandlers } from 'stream-chat-react-native-core';
|
|
15
15
|
|
|
16
|
-
import
|
|
16
|
+
import AudioVideoPlayer from './optionalDependencies/Video';
|
|
17
17
|
|
|
18
18
|
registerNativeHandlers({
|
|
19
19
|
compressImage: async ({ compressImageQuality = 1, height, uri, width }) => {
|
|
@@ -199,6 +199,30 @@ registerNativeHandlers({
|
|
|
199
199
|
throw new Error('Sharing failed...');
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
|
+
Sound: {
|
|
203
|
+
initializeSound: null,
|
|
204
|
+
// eslint-disable-next-line react/display-name
|
|
205
|
+
Player: AudioVideoPlayer
|
|
206
|
+
? ({ onBuffer, onEnd, onLoad, onProgress, paused, soundRef, style, uri }) => (
|
|
207
|
+
<AudioVideoPlayer
|
|
208
|
+
audioOnly={true}
|
|
209
|
+
onBuffer={onBuffer}
|
|
210
|
+
onEnd={onEnd}
|
|
211
|
+
onError={(error) => {
|
|
212
|
+
console.log(error);
|
|
213
|
+
}}
|
|
214
|
+
onLoad={onLoad}
|
|
215
|
+
onProgress={onProgress}
|
|
216
|
+
paused={paused}
|
|
217
|
+
ref={soundRef}
|
|
218
|
+
source={{
|
|
219
|
+
uri,
|
|
220
|
+
}}
|
|
221
|
+
style={style}
|
|
222
|
+
/>
|
|
223
|
+
)
|
|
224
|
+
: null,
|
|
225
|
+
},
|
|
202
226
|
takePhoto: async ({ compressImageQuality = Platform.OS === 'ios' ? 0.8 : 1 }) => {
|
|
203
227
|
const photo = await ImagePicker.openCamera({
|
|
204
228
|
compressImageQuality: Math.min(Math.max(0, compressImageQuality), 1),
|
|
@@ -250,24 +274,26 @@ registerNativeHandlers({
|
|
|
250
274
|
});
|
|
251
275
|
},
|
|
252
276
|
// eslint-disable-next-line react/display-name
|
|
253
|
-
Video:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
277
|
+
Video: AudioVideoPlayer
|
|
278
|
+
? ({ onBuffer, onEnd, onLoad, onProgress, paused, style, uri, videoRef }) => (
|
|
279
|
+
<AudioVideoPlayer
|
|
280
|
+
ignoreSilentSwitch={'ignore'}
|
|
281
|
+
onBuffer={onBuffer}
|
|
282
|
+
onEnd={onEnd}
|
|
283
|
+
onError={(error) => {
|
|
284
|
+
console.error(error);
|
|
285
|
+
}}
|
|
286
|
+
onLoad={onLoad}
|
|
287
|
+
onProgress={onProgress}
|
|
288
|
+
paused={paused}
|
|
289
|
+
ref={videoRef}
|
|
290
|
+
source={{
|
|
291
|
+
uri,
|
|
292
|
+
}}
|
|
293
|
+
style={style}
|
|
294
|
+
/>
|
|
295
|
+
)
|
|
296
|
+
: null,
|
|
271
297
|
});
|
|
272
298
|
|
|
273
299
|
if (Platform.OS === 'android') {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
let
|
|
1
|
+
let AudioVideoComponent;
|
|
2
2
|
try {
|
|
3
3
|
// eslint-disable-next-line no-undef
|
|
4
4
|
const videoPackage = require('react-native-video');
|
|
5
|
-
|
|
5
|
+
AudioVideoComponent = videoPackage.default;
|
|
6
6
|
} catch (_) {
|
|
7
7
|
console.warn(
|
|
8
8
|
'Video library is currently not installed. To allow in-app video playback, install the "react-native-video" package.',
|
|
9
9
|
);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export default
|
|
12
|
+
export default AudioVideoComponent;
|