-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix RCTView width NaN crash with react-native-video-controls in full …
…screen mode Patch was provided here: itsnubix/react-native-video-controls#238 (comment)
- Loading branch information
1 parent
551fc41
commit 1872520
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|