Skip to content

Commit

Permalink
chore: update docs link (#4242)
Browse files Browse the repository at this point in the history
  • Loading branch information
moskalakamil authored Nov 7, 2024
1 parent f78a407 commit 0288d61
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 69 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
🎬 `<Video>` component for React Native

## Documentation
documentation is available at [thewidlarzgroup.github.io/react-native-video/](https://thewidlarzgroup.github.io/react-native-video/)
documentation is available at [docs.thewidlarzgroup.com/react-native-video/](https://docs.thewidlarzgroup.com/react-native-video/)

## Examples
You can find several examples demonstrating the usage of react-native-video [here](https://github.com/TheWidlarzGroup/react-native-video/tree/master/examples). <br />
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You can remove following lines from your podfile as they are not necessary anymo
- `pod 'react-native-video/VideoCaching', :path => '../node_modules/react-native-video/react-native-video.podspec'`
```

If you were previously using VideoCaching, you should $RNVideoUseVideoCaching flag in your podspec, see: [installation section](https://thewidlarzgroup.github.io/react-native-video/installation#video-caching)
If you were previously using VideoCaching, you should $RNVideoUseVideoCaching flag in your podspec, see: [installation section](https://docs.thewidlarzgroup.com/react-native-video/installation#video-caching)

#### Android

Expand Down
Binary file added docs/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 18 additions & 4 deletions docs/theme.config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
/>
<meta
name="og:image"
content="https://thewidlarzgroup.github.io/react-native-video/thumbnail.jpg"
content="https://docs.thewidlarzgroup.com/react-native-video/thumbnail.jpg"
/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="React Native Video" />
Expand All @@ -23,7 +23,7 @@ export default {
/>
<meta
name="twitter:image"
content="https://thewidlarzgroup.github.io/react-native-video/thumbnail.jpg"
content="https://docs.thewidlarzgroup.com/react-native-video/thumbnail.jpg"
/>
<meta name="twitter:image:alt" content="React Native Video" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
Expand All @@ -32,14 +32,28 @@ export default {
href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&display=swap"
rel="stylesheet"
/>
<link
rel="icon"
type="image/png"
href="https://docs.thewidlarzgroup.com/react-native-video/favicon.png"
/>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-PM2TQQQMDN"
/>
<script>
{`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-PM2TQQQMDN');`}
</script>
</>
),
logo: (
<span>
🎬 <strong>Video component</strong> for React Native
</span>
),
faviconGlyph: '🎬',
project: {
link: 'https://github.com/TheWidlarzGroup/react-native-video',
},
Expand All @@ -57,7 +71,7 @@ export default {
<>
<style>{`
:is(html[class~=dark]) .extra-container {
background-color: #87ccef;
background-color: #87ccef;
}
:is(html[class~=dark]) .extra-text {
color: #171717;
Expand Down
142 changes: 82 additions & 60 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Examples

This directory contains examples for `react-native-video` - this is a guide that will show you what can you find here and how to use them.

## Examples Structure
Expand All @@ -9,8 +10,8 @@ This directory contains examples for `react-native-video` - this is a guide that

### Updating Examples Content

Both of applications have mostly the same code (Windows and tvOS have platform-specific code). Other platform are using codebase from `bare` example.
If you want to update examples content, you should do it in `bare` example. `expo` example is copping (and overwriting!) `src` folder from `bare` on dependency install.
Both of applications have mostly the same code (Windows and tvOS have platform-specific code). Other platform are using codebase from `bare` example.
If you want to update examples content, you should do it in `bare` example. `expo` example is copping (and overwriting!) `src` folder from `bare` on dependency install.
If you want to sync `expo` example, you can use `yarn update-src` command in `expo` example directory.

## How To Run Examples
Expand All @@ -22,54 +23,63 @@ If you want to sync `expo` example, you can use `yarn update-src` command in `ex
You can configure the example by changing the settings of expo-plugin `app.json` file in the `bare` directory.

> [!TIP]
> You can find more information about the expo-plugin configuration [here](https://thewidlarzgroup.github.io/react-native-video/other/expo).
> You can find more information about the expo-plugin configuration [here](https://docs.thewidlarzgroup.com/react-native-video/other/expo).
> [!CAUTION]
> You will need to regenerate the native project after changing the `app.json` file. eg. on Apple platforms you will need to install pods twice. (one for applying expo-plugin changes and second for applying react-native-video changes)
### Building

1. Install dependency in repository root directory

```bash
yarn install
```

2. Install dependency in `bare` example directory

```bash
cd examples/bare && yarn install
```

3. Now you will need to generate native project for platform you want to run the example on.
- For iOS / visionOS:
Install pods in `ios` / `visionOS` directory
```bash
# for ios
pod install --project-directory=ios
# for visionOS
pod install --project-directory=visionos
```
⚠️ You will need to hit it twice, because expo-plugin changes are not applied in the first run.

Now you are ready to run the App. (Flag `--interactive` is optional, but it is recommended as it allows you to choose the device you want to run the app on. Select `BareExample` scheme)
```bash
# for ios
yarn ios --interactive
# for visionOS
yarn visionos --interactive
```

- For Android:
There is no need to run any additional command. you can just run the App. (Flag `--interactive` is optional, but it is recommended as it allows you to choose the device you want to run the app on)
```bash
yarn android --interactive
```

- For Windows:
There is no need to run any additional command. you can just run the App.
```bash
yarn windows
```

- For iOS / visionOS:
Install pods in `ios` / `visionOS` directory

```bash
# for ios
pod install --project-directory=ios
# for visionOS
pod install --project-directory=visionos
```

⚠️ You will need to hit it twice, because expo-plugin changes are not applied in the first run.

Now you are ready to run the App. (Flag `--interactive` is optional, but it is recommended as it allows you to choose the device you want to run the app on. Select `BareExample` scheme)

```bash
# for ios
yarn ios --interactive
# for visionOS
yarn visionos --interactive
```

- For Android:
There is no need to run any additional command. you can just run the App. (Flag `--interactive` is optional, but it is recommended as it allows you to choose the device you want to run the app on)

```bash
yarn android --interactive
```

- For Windows:
There is no need to run any additional command. you can just run the App.
```bash
yarn windows
```

If Metro Bundler is not running (or it did not start), you can start it by running:

```bash
yarn start
```
Expand All @@ -82,54 +92,60 @@ yarn start
### Configuration
#### Expo Plugin
You can configure the example by changing the settings of expo-plugin `app.json` file in the `expo` directory.
> [!TIP]
> You can find more information about the expo-plugin configuration [here](https://thewidlarzgroup.github.io/react-native-video/other/expo).
> You can find more information about the expo-plugin configuration [here](https://docs.thewidlarzgroup.com/react-native-video/other/expo).
> [!CAUTION]
> You will need to regenerate the native project after changing the `app.json` file - you can do it by running `yarn prebuild` command in `expo` example directory.
#### Switching between Mobile and TV
If you want to switch between mobile and TV version of the app you will need to regenerate the native project. You can do it by running `yarn prebuild:tv` command in `expo` example directory.
If you want to switch between mobile and TV version of the app you will need to regenerate the native project. You can do it by running `yarn prebuild:tv` command in `expo` example directory.
### Building
1. Install dependency in repository root directory
```bash
yarn install
```
2. Install dependency in `expo` example directory
```bash
cd examples/expo && yarn install
```
3. Now you will need to generate native project for platform you want to run the example on.
If you want to use example on tv you should read [Switching between Mobile and TV](#switching-between-mobile-and-tv) section.
- For iOS / tvOS:
Install pods in `ios` directory
```bash
pod install --project-directory=ios
```
Now you are ready to run the App. (Flag `--device` is optional, but it is recommended as it allows you to choose the device you want to run the app on)
```bash
# for ios
yarn ios --device
# for tvOS
yarn ios:tv --device
```
- For Android / Android TV:
There is no need to run any additional command. you can just run the App. (Flag `--device` is optional, but it is recommended as it allows you to choose the device you want to run the app on)
```bash
# for android
yarn android --device
# for android tv
yarn android:tv --device
```
3. Now you will need to generate native project for platform you want to run the example on.
If you want to use example on tv you should read [Switching between Mobile and TV](#switching-between-mobile-and-tv) section.
- For iOS / tvOS:
Install pods in `ios` directory
```bash
pod install --project-directory=ios
```
Now you are ready to run the App. (Flag `--device` is optional, but it is recommended as it allows you to choose the device you want to run the app on)
```bash
# for ios
yarn ios --device
# for tvOS
yarn ios:tv --device
```
- For Android / Android TV:
There is no need to run any additional command. you can just run the App. (Flag `--device` is optional, but it is recommended as it allows you to choose the device you want to run the app on)
```bash
# for android
yarn android --device
# for android tv
yarn android:tv --device
```
> [!WARNING]
> Setup for android is not complete yet. Please use bare app for android testing.
Expand All @@ -138,15 +154,18 @@ cd examples/expo && yarn install
Support for web is coming soon.
If Metro Bundler is not running (or it did not start), you can start it by running:
```bash
yarn start
```
## For Maintainers
### Opening React Native Video in Android Studio / Xcode
To open `react-native-video` in Android Studio / Xcode you need to open `examples/bare/android` or `examples/bare/ios` directory.
First, you need to follow the [How To Run Examples](#how-to-run-examples) guide to generate the native project. Then you can open the project in Android Studio / Xcode by running below command in `examples/bare` directory.
```bash
# for android
studio ./android
Expand All @@ -157,16 +176,19 @@ xed ./ios
### Updating Examples
#### Bare
Because `bare` example is using react-native-test-app it is very easy to update it.
Because `bare` example is using react-native-test-app it is very easy to update it.
1. Change version of `react-native` in `package.json` file in `bare` directory.
2. Hit below command and verify if everything is working correctly - RN_VERSION should be the version you want to update to.
```bash
npx @rnx-kit/align-deps@latest --requirements react-native@RN_VERSION --write
```
That's it! Now you can commit changes and create a PR.

#### Expo

To update `expo` example you should follow this [guide](https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough).
After updating `expo` example you will need to use prebuild (yarn expo prebuild) - if it fails you will need to add `--clean` flag to the command - this will remove manual link of `react-native-video` package so you will need to link it again.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"react-native": "src/index",
"license": "MIT",
"author": "Community Contributors",
"homepage": "https://thewidlarzgroup.github.io/react-native-video/",
"homepage": "https://docs.thewidlarzgroup.com/react-native-video/",
"repository": {
"type": "git",
"url": "git@github.com:TheWidlarzGroup/react-native-video.git"
Expand Down
4 changes: 2 additions & 2 deletions src/expo-plugins/@types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export type ConfigProps = {
/**
* Whether to include ADS extension in the app (IMA SDK)
* @default false
* @see https://thewidlarzgroup.github.io/react-native-video/component/ads
* @see https://docs.thewidlarzgroup.com/react-native-video/component/ads
*/
enableADSExtension?: boolean;
/**
* Whether to enable cache extension for ios in the app.
* @default false
* @see https://thewidlarzgroup.github.io/react-native-video/other/caching
* @see https://docs.thewidlarzgroup.com/react-native-video/other/caching
*/
enableCacheExtension?: boolean;
/**
Expand Down

0 comments on commit 0288d61

Please sign in to comment.