From 8bda6546e878f31d0e8eb778e099d703ce646dd5 Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Fri, 28 Sep 2018 10:30:24 -0700 Subject: [PATCH] Document headers prop --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 178a54b0..d1094d54 100644 --- a/README.md +++ b/README.md @@ -253,6 +253,7 @@ var styles = StyleSheet.create({ * [audioOnly](#audioonly) * [bufferConfig](#bufferconfig) * [controls](#controls) +* [headers](#headers) * [ignoreSilentSwitch](#ignoresilentswitch) * [muted](#muted) * [paused](#paused) @@ -340,6 +341,21 @@ Note on iOS, controls are always shown when in fullscreen mode. Platforms: DOM, iOS +#### headers +Pass headers to the HTTP client. Can be used for authorization. + +To enable this on iOS, you will need to manually edit RCTVideo.m and uncomment the header code in the playerItemForSource function. This is because the code used a private API and may cause your app to be rejected by the App Store. Use at your own risk. + +Example: +``` +headers = {{ + Authorization: 'bearer some-token-value', + 'X-Custom-Header': 'some value' +}} +``` + +Platforms: Android ExoPlayer + #### ignoreSilentSwitch Controls the iOS silent switch behavior * **"inherit" (default)** - Use the default AVPlayer behavior