feat: add expo plugins (#3933)
* feat: add expo plugins * add export * fix import * fix bugs * build `lib` to `CommonJS` * restore `build.gradle` * remove plugin tmp * add expo plugin for ios caching * add docs for expo plugin * fix expo plugin export * fix docs
This commit is contained in:
@@ -49,6 +49,8 @@ To enable google IMA usage define add following line in your podfile:
|
||||
$RNVideoUseGoogleIMA=true
|
||||
```
|
||||
|
||||
**If you are using Expo you can use [expo plugin](other/expo.md) for it**
|
||||
|
||||
</details>
|
||||
<details>
|
||||
<summary>Android</summary>
|
||||
@@ -67,6 +69,8 @@ buildscript {
|
||||
|
||||
### Enable custom feature in gradle file
|
||||
|
||||
**If you are using Expo you can use [expo plugin](other/expo.md) for it**
|
||||
|
||||
You can disable or enable the following features by setting the following variables in your `android/build.gradle` file:
|
||||
- `useExoplayerIMA` - Enable Google IMA SDK (Ads support)
|
||||
- `useExoplayerRtsp` - Enable RTSP support
|
||||
|
@@ -3,5 +3,6 @@
|
||||
"misc": "Misc",
|
||||
"debug": "Debugging",
|
||||
"new-arch": "New Architecture",
|
||||
"expo": "Expo"
|
||||
"plugin": "Plugin (experimental)"
|
||||
}
|
40
docs/pages/other/expo.md
Normal file
40
docs/pages/other/expo.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Expo
|
||||
|
||||
## Expo plugin
|
||||
From version `6.3.1`, we have added support for expo plugin. You can configure `react-native-video` properties in `app.json` (or `app.config.json` or `app.config.js`) file.
|
||||
It's useful when you are using `expo` managed workflow (expo prebuild) as it will automatically configure `react-native-video` properties in native part of the expo project.
|
||||
|
||||
```json
|
||||
// app.json
|
||||
{
|
||||
{
|
||||
"name": "my app",
|
||||
"plugins": [
|
||||
[
|
||||
"react-native-video",
|
||||
{
|
||||
// ...
|
||||
"enableNotificationControls": true,
|
||||
"androidExtensions": {
|
||||
"useExoplayerRtsp": false,
|
||||
"useExoplayerSmoothStreaming": false,
|
||||
"useExoplayerHls": false,
|
||||
"useExoplayerDash": false,
|
||||
}
|
||||
// ...
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Expo Plugin Properties
|
||||
|
||||
| Property | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| enableNotificationControls | boolean | false | Add required changes on android to use notification controls for video player |
|
||||
| enableBackgroundAudio | boolean | false | Add required changes to play video in background on iOS |
|
||||
| enableADSExtension | boolean | false | Add required changes to use ads extension for video player |
|
||||
| enableCacheExtension | boolean | false | Add required changes to use cache extension for video player on iOS |
|
||||
| androidExtensions | object | {} | You can enable/disable extensions as per your requirement - this allow to reduce library size on android |
|
Reference in New Issue
Block a user