diff --git a/package.json b/package.json index 22f9a2b04..79036171d 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "react-native-tracking-transparency": "0.1.1", "react-native-vector-icons": "8.1.0", "react-native-video": "6.0.0-alpha.4", - "react-native-video-controls": "^2.8.1", + "react-native-video-controls": "2.8.1", "react-native-webview": "11.26.0", "react-native-xml2js": "1.0.3", "react-navigation": "4.4.4", diff --git a/patches/react-native-video-controls+2.8.1.patch b/patches/react-native-video-controls+2.8.1.patch new file mode 100644 index 000000000..8abc11fc6 --- /dev/null +++ b/patches/react-native-video-controls+2.8.1.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/react-native-video-controls/VideoPlayer.js b/node_modules/react-native-video-controls/VideoPlayer.js +index 7d36b4b..e300dc4 100644 +--- a/node_modules/react-native-video-controls/VideoPlayer.js ++++ b/node_modules/react-native-video-controls/VideoPlayer.js +@@ -613,7 +613,7 @@ export default class VideoPlayer extends Component { + * @return {float} position of seeker handle in px based on currentTime + */ + calculateSeekerPosition() { +- const percent = this.state.currentTime / this.state.duration; ++ const percent = this.state.duration === 0 ? 0 : this.state.currentTime / this.state.duration; + return this.player.seekerWidth * percent; + } +