stream-chat-react-native 4.11.1-beta.2 → 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 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.11.1-beta.2",
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.11.1-beta.2"
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 Video from './optionalDependencies/Video';
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: Video ? ({ onBuffer, onEnd, onLoad, onProgress, paused, style, uri, videoRef }) => (
254
- <Video
255
- ignoreSilentSwitch={'ignore'}
256
- onBuffer={onBuffer}
257
- onEnd={onEnd}
258
- onError={(error) => {
259
- console.error(error);
260
- }}
261
- onLoad={onLoad}
262
- onProgress={onProgress}
263
- paused={paused}
264
- ref={videoRef}
265
- source={{
266
- uri,
267
- }}
268
- style={style}
269
- />
270
- ) : null,
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 VideoComponent;
1
+ let AudioVideoComponent;
2
2
  try {
3
3
  // eslint-disable-next-line no-undef
4
4
  const videoPackage = require('react-native-video');
5
- VideoComponent = videoPackage.default;
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 VideoComponent;
12
+ export default AudioVideoComponent;