diff --git a/README.md b/README.md
index 26c07e4..a22f498 100644
--- a/README.md
+++ b/README.md
@@ -108,6 +108,7 @@ allprojects {
| onHideControls | Callback for when the controls are being hide. |
| onShowControls | Callback for when the controls are being shown. |
| customStyles | The player can be customized in this object, see customStyles for the options. |
+| renderOverlayComponent | Render an overlay component on top of the video, but under controls / play button. |
All other props are passed to the react-native-video component.
diff --git a/index.js b/index.js
index 513f4e3..1276744 100644
--- a/index.js
+++ b/index.js
@@ -118,7 +118,8 @@ const styles = StyleSheet.create({
},
durationText: {
color: 'white'
- }
+ },
+ overlayComponentWrapper: StyleSheet.absoluteFill,
});
export default class VideoPlayer extends Component {
@@ -427,6 +428,7 @@ export default class VideoPlayer extends Component {
]}
source={thumbnail}
>
+ {this.renderOverlay()}
{this.renderStartButton()}
);
@@ -521,6 +523,14 @@ export default class VideoPlayer extends Component {
);
}
+ renderOverlay() {
+ return this.props.renderOverlayComponent ? (
+
+ {this.props.renderOverlayComponent()}
+
+ ) : null;
+ }
+
renderVideo() {
const {
video,
@@ -559,6 +569,7 @@ export default class VideoPlayer extends Component {
{ marginTop: -this.getSizeStyles().height },
]}
>
+ {this.renderOverlay()}
{
@@ -590,6 +601,7 @@ export default class VideoPlayer extends Component {
} else if (!isStarted) {
return (
+ {this.renderOverlay()}
{this.renderStartButton()}
);
diff --git a/package.json b/package.json
index 52abeff..bd203ea 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-video-player",
- "version": "0.14.0",
+ "version": "0.14.1",
"description": "A video player for React Native with controls",
"main": "index.js",
"scripts": {
@@ -21,7 +21,7 @@
"react": "*",
"react-native": "*",
"react-native-vector-icons": ">= 2.1.0",
- "react-native-video": "^2.0.0"
+ "react-native-video": ">=5"
},
"devDependencies": {
"eslint": "^3.4.0",