From 994da821e04a5e8dd26bbc1b1512e3fbb9bd0e20 Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Mon, 27 Aug 2018 16:22:13 -0700 Subject: [PATCH] Reorganize README to put more links in the table of contents --- README.md | 62 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index b174c569..4d15b336 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,13 @@ Version 4.0.0 now requires Android SDK 26 or higher to use ExoPlayer. This is th ### Version 3.0.0 breaking changes Version 3.0 features a number of changes to existing behavior. See [Updating](#updating) for changes. -## TOC +## Table of Contents * [Installation](#installation) * [Usage](#usage) +* [iOS App Transport Security](#ios-app-transport-security) +* [Audio Mixing](#audio-mixing) +* [Android Expansion File Usage](#android-expansion-file-usage) * [Updating](#updating) ## Installation @@ -31,48 +34,33 @@ or using yarn: yarn add react-native-video ``` +Then follow the instructions for your platform to link react-native-video into your project: +
iOS +### Standard Method + Run `react-native link react-native-video` to link the react-native-video library. -If you would like to allow other apps to play music over your video component, add: +### Using CocoaPods (required to enable caching) -**AppDelegate.m** - -```objective-c -#import // import - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - ... - [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; // allow - ... -} -``` -Note: you can also use the `ignoreSilentSwitch` prop, shown below. -
- -
- iOS (CocoaPods) Setup your Podfile like it is described in the [react-native documentation](https://facebook.github.io/react-native/docs/integration-with-existing-apps#configuring-cocoapods-dependencies). Depending on your requirements you have to choose between the two possible subpodspecs: -video only: +Video only: ```diff pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' - + `pod 'react-native-video', :path => '../node_modules/react-native-video/react-native-video.podspec'` end ``` -video with caching (you can learn more about caching [here](docs/caching.md): +Video with caching ([more info](docs/caching.md)): ```diff pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' - + `pod 'react-native-video/VideoCaching', :path => '../node_modules/react-native-video/react-native-video.podspec'` end ``` @@ -742,17 +730,37 @@ this.player.seek(120, 50); // Seek to 2 minutes with +/- 50 milliseconds accurac Platforms: iOS -### Additional props +### iOS App Transport Security -To see the full list of available props, you can check the [propTypes](https://github.com/react-native-community/react-native-video/blob/master/Video.js#L246) of the Video.js component. - -- By default, iOS 9+ will only load encrypted HTTPS urls. If you need to load content from a webserver that only supports HTTP, you will need to modify your Info.plist file and add the following entry: +- By default, iOS will only load encrypted (https) urls. If you want to load content from an unencrypted (http) source, you will need to modify your Info.plist file and add the following entry: For more detailed info check this [article](https://cocoacasts.com/how-to-add-app-transport-security-exception-domains)
+### Audio Mixing + +At some point in the future, react-native-video will include an Audio Manager for configuring how videos mix with other apps playing sounds on the device. + +On iOS, if you would like to allow other apps to play music over your video component, make the following change: + +**AppDelegate.m** + +```objective-c +#import // import + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + ... + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; // allow + ... +} +``` + +You can also use the [ignoreSilentSwitch](ignoresilentswitch) prop. + + ### Android Expansion File Usage Expansions files allow you to ship assets that exceed the 100MB apk size limit and don't need to be updated each time you push an app update.