Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PropsType is getting undefined #182

Open
bhavinatharva opened this issue May 28, 2024 · 2 comments
Open

PropsType is getting undefined #182

bhavinatharva opened this issue May 28, 2024 · 2 comments

Comments

@bhavinatharva
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-video-player@0.14.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-video-player/index.js b/node_modules/react-native-video-player/index.js
index ed9965b..0d55654 100644
--- a/node_modules/react-native-video-player/index.js
+++ b/node_modules/react-native-video-player/index.js
@@ -606,58 +606,58 @@ export default class VideoPlayer extends Component {
   }
 }
 
-VideoPlayer.propTypes = {
-  video: Video.propTypes.source,
-  thumbnail: ImagePropTypes.source,
-  endThumbnail: ImagePropTypes.source,
-  videoWidth: PropTypes.number,
-  videoHeight: PropTypes.number,
-  duration: PropTypes.number,
-  autoplay: PropTypes.bool,
-  paused: PropTypes.bool,
-  defaultMuted: PropTypes.bool,
-  muted: PropTypes.bool,
-  style: ViewPropTypesVar.style,
-  controlsTimeout: PropTypes.number,
-  disableControlsAutoHide: PropTypes.bool,
-  disableFullscreen: PropTypes.bool,
-  loop: PropTypes.bool,
-  resizeMode: Video.propTypes.resizeMode,
-  hideControlsOnStart: PropTypes.bool,
-  endWithThumbnail: PropTypes.bool,
-  disableSeek: PropTypes.bool,
-  pauseOnPress: PropTypes.bool,
-  fullScreenOnLongPress: PropTypes.bool,
-  customStyles: PropTypes.shape({
-    wrapper: ViewPropTypesVar.style,
-    video: Video.propTypes.style,
-    videoWrapper: ViewPropTypesVar.style,
-    controls: ViewPropTypesVar.style,
-    playControl: ViewPropTypesVar.style,
-    controlButton: ViewPropTypesVar.style,
-    controlIcon: Icon.propTypes.style,
-    playIcon: Icon.propTypes.style,
-    seekBar: ViewPropTypesVar.style,
-    seekBarFullWidth: ViewPropTypesVar.style,
-    seekBarProgress: ViewPropTypesVar.style,
-    seekBarKnob: ViewPropTypesVar.style,
-    seekBarKnobSeeking: ViewPropTypesVar.style,
-    seekBarBackground: ViewPropTypesVar.style,
-    thumbnail: ImagePropTypes.style,
-    playButton: ViewPropTypesVar.style,
-    playArrow: Icon.propTypes.style,
-    durationText: ViewPropTypesVar.style
-  }),
-  onEnd: PropTypes.func,
-  onProgress: PropTypes.func,
-  onLoad: PropTypes.func,
-  onStart: PropTypes.func,
-  onPlayPress: PropTypes.func,
-  onHideControls: PropTypes.func,
-  onShowControls: PropTypes.func,
-  onMutePress: PropTypes.func,
-  showDuration: PropTypes.bool
-};
+// VideoPlayer.propTypes = {
+//   video: Video.propTypes.source,
+//   thumbnail: ImagePropTypes.source,
+//   endThumbnail: ImagePropTypes.source,
+//   videoWidth: PropTypes.number,
+//   videoHeight: PropTypes.number,
+//   duration: PropTypes.number,
+//   autoplay: PropTypes.bool,
+//   paused: PropTypes.bool,
+//   defaultMuted: PropTypes.bool,
+//   muted: PropTypes.bool,
+//   style: ViewPropTypesVar.style,
+//   controlsTimeout: PropTypes.number,
+//   disableControlsAutoHide: PropTypes.bool,
+//   disableFullscreen: PropTypes.bool,
+//   loop: PropTypes.bool,
+//   resizeMode: Video.propTypes.resizeMode,
+//   hideControlsOnStart: PropTypes.bool,
+//   endWithThumbnail: PropTypes.bool,
+//   disableSeek: PropTypes.bool,
+//   pauseOnPress: PropTypes.bool,
+//   fullScreenOnLongPress: PropTypes.bool,
+//   customStyles: PropTypes.shape({
+//     wrapper: ViewPropTypesVar.style,
+//     video: Video.propTypes.style,
+//     videoWrapper: ViewPropTypesVar.style,
+//     controls: ViewPropTypesVar.style,
+//     playControl: ViewPropTypesVar.style,
+//     controlButton: ViewPropTypesVar.style,
+//     controlIcon: Icon.propTypes.style,
+//     playIcon: Icon.propTypes.style,
+//     seekBar: ViewPropTypesVar.style,
+//     seekBarFullWidth: ViewPropTypesVar.style,
+//     seekBarProgress: ViewPropTypesVar.style,
+//     seekBarKnob: ViewPropTypesVar.style,
+//     seekBarKnobSeeking: ViewPropTypesVar.style,
+//     seekBarBackground: ViewPropTypesVar.style,
+//     thumbnail: ImagePropTypes.style,
+//     playButton: ViewPropTypesVar.style,
+//     playArrow: Icon.propTypes.style,
+//     durationText: ViewPropTypesVar.style
+//   }),
+//   onEnd: PropTypes.func,
+//   onProgress: PropTypes.func,
+//   onLoad: PropTypes.func,
+//   onStart: PropTypes.func,
+//   onPlayPress: PropTypes.func,
+//   onHideControls: PropTypes.func,
+//   onShowControls: PropTypes.func,
+//   onMutePress: PropTypes.func,
+//   showDuration: PropTypes.bool
+// };
 
 VideoPlayer.defaultProps = {
   videoWidth: 1280,

This issue body was partially generated by patch-package.

@hzhoanglee
Copy link

As I see, they are identical. Or am I missing something?

@mlazari
Copy link

mlazari commented Aug 14, 2024

As I see, they are identical. Or am I missing something?

@hzhoanglee I think you're missing that it's just commenting out those lines, not replacing them with something else. Video.propTypes is undefined with the latest react-native-video versions, which makes that code throw an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants