stream-chat-expo 9.4.0-beta.8 → 9.4.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,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-expo",
3
3
  "description": "The official Expo SDK for Stream Chat, a service for building chat applications",
4
- "version": "9.4.0-beta.8",
4
+ "version": "9.4.0",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -27,7 +27,7 @@
27
27
  "types": "types/index.d.ts",
28
28
  "dependencies": {
29
29
  "mime": "^4.0.7",
30
- "stream-chat-react-native-core": "9.4.0-beta.8"
30
+ "stream-chat-react-native-core": "9.4.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "expo": ">=52.0.0",
@@ -23,6 +23,23 @@ const useVideoPlayer = videoPackage?.useVideoPlayer;
23
23
 
24
24
  let Video = null;
25
25
 
26
+ /**
27
+ * Tuned for chat gallery clips. expo-video's defaults are way too
28
+ * generous (Android: 20s read ahead, no byte cap and ExoPlayer
29
+ * picks based on bitrate). These values cap each player instance at roughly
30
+ * 5-6 MB while still giving a comfortable margin against network stalls.
31
+ * Integrators with different needs can replace this wrapper via
32
+ * `registerNativeHandlers({ Video: ... })`.
33
+ *
34
+ * Per expo-video docs the whole object must be assigned at once and setting
35
+ * individual properties on `player.bufferOptions` is not supported.
36
+ */
37
+ const BUFFER_OPTIONS = {
38
+ maxBufferBytes: 6_000_000, // Android only, ~6 MB hard cap
39
+ minBufferForPlayback: 1, // Android only, seconds before playback can start
40
+ preferredForwardBufferDuration: 10, // both platforms, seconds
41
+ };
42
+
26
43
  // expo-video
27
44
  if (videoPackage) {
28
45
  Video = ({
@@ -38,6 +55,7 @@ if (videoPackage) {
38
55
  }) => {
39
56
  const player = useVideoPlayer(uri, (player) => {
40
57
  player.timeUpdateEventInterval = 0.5;
58
+ player.bufferOptions = BUFFER_OPTIONS;
41
59
  videoRef.current = player;
42
60
  });
43
61