Skip to content

Commit 54e1354

Browse files
authored
docs: add android steps for react-native-video (#1656)
1 parent 09a0cf7 commit 54e1354

1 file changed

Lines changed: 47 additions & 12 deletions

File tree

docusaurus/docs/reactnative/basics/getting_started.mdx

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ Most if not all of the required packages now support auto-linking so setup shoul
6060
- [`react-native-safe-area-context`](https://github.com/th3rdwave/react-native-safe-area-context)
6161
- [`react-native-share`](https://github.com/react-native-share/react-native-share)
6262
- [`react-native-svg`](https://github.com/react-native-svg/react-native-svg)
63-
- [`react-native-video`](https://github.com/react-native-video/react-native-video)
6463

6564
<Tabs
6665
defaultValue='yarn'
@@ -72,14 +71,14 @@ Most if not all of the required packages now support auto-linking so setup shoul
7271
<TabItem value='yarn'>
7372

7473
```bash
75-
yarn add @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg react-native-video
74+
yarn add @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg
7675
```
7776

7877
</TabItem>
7978
<TabItem value='npm'>
8079

8180
```bash
82-
npm install @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg react-native-video
81+
npm install @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg
8382
```
8483

8584
</TabItem>
@@ -161,12 +160,43 @@ If you are planning to use file picker functionality, make sure you enable iClou
161160

162161
### Add Optional Dependencies
163162

164-
- `react-native-video` - [additional installation steps](https://github.com/react-native-video/react-native-video/blob/master/API.md#installation)
163+
#### Video playing support
165164

166-
> Available in stream-chat-react-native >= v4.7.0
165+
Install `react-native-video` in your React Native project.
167166

168-
Installing this package allows you to play the video files/attachments in the chat. Otherwise by default, video files will be opened in default
169-
browser of the device.
167+
> Available in stream-chat-react-native >= v4.7.0
168+
169+
Installing this package allows you to play the video files/attachments in the chat. Otherwise by default, video files will be opened in default browser of the device.
170+
171+
<Tabs
172+
defaultValue='yarn'
173+
values={[
174+
{ label: 'Yarn', value: 'yarn' },
175+
{ label: 'npm', value: 'npm' },
176+
]}
177+
>
178+
<TabItem value='yarn'>
179+
180+
```bash
181+
yarn add react-native-video
182+
```
183+
184+
</TabItem>
185+
<TabItem value='npm'>
186+
187+
```bash
188+
npm install react-native-video
189+
```
190+
191+
</TabItem>
192+
</Tabs>
193+
194+
We require [exoplayer](https://github.com/google/ExoPlayer) to be the media player on Android. To make `react-native-video` to use exoplayer, add the following in `android/settings.gradle`:
195+
196+
```
197+
include ':react-native-video'
198+
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
199+
```
170200

171201
### AndroidX Support
172202

@@ -187,7 +217,7 @@ Stream Chat for React Native is set up for parity on Expo, expo requires a diffe
187217

188218
```bash
189219
expo install stream-chat-expo
190-
expo install @react-native-community/netinfo expo-document-picker expo-file-system expo-haptics expo-image-manipulator expo-image-picker expo-media-library expo-sharing react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg expo-av
220+
expo install @react-native-community/netinfo expo-document-picker expo-file-system expo-haptics expo-image-manipulator expo-image-picker expo-media-library expo-sharing react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg
191221
```
192222

193223
### Additional Steps
@@ -239,9 +269,14 @@ For some of the packages listed below, there are additional steps required to se
239269

240270
### Add Optional Dependencies
241271

242-
- `expo-av` - [additional installation steps](https://docs.expo.dev/versions/v45.0.0/sdk/video/)
272+
#### Video playing support
273+
274+
Install `expo-av` in your React Native project.
243275

244-
> Available in stream-chat-expo >= v4.7.0
276+
> Available in stream-chat-expo >= v4.7.0
245277

246-
Installing this package allows you to play the video files/attachments in the chat. Otherwise by default, video files will be opened in default
247-
browser of the device.
278+
Installing this package allows you to play the video files/attachments in the chat. Otherwise by default, video files will be opened in default browser of the device.
279+
280+
```bash
281+
expo install expo-av
282+
```

0 commit comments

Comments
 (0)