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 · 9 comments
Open

PropsType is getting undefined #182

bhavinatharva opened this issue May 28, 2024 · 9 comments

Comments

@bhavinatharva
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] 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.

Copy link
Contributor

github-actions bot commented Dec 3, 2024

This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.

@github-actions github-actions bot added the stale Closed due to inactivity or lack or resources label Dec 3, 2024
@Shivangi2909
Copy link

I am still facing same issue when using react-native-video version 6.8.2, react-native-video-player version0.14.0 and react-native version 0.76.3

@mlazari
Copy link

mlazari commented Dec 9, 2024

@Shivangi2909 I didn't try it yet, but I assume it should be fixed in the latest beta version, "react-native-video-player": "0.15.0-beta.3",.

@Shivangi2909
Copy link

Shivangi2909 commented Dec 9, 2024

@mlazari Thanks for the response, this version resolved the crash but it looks like its audioOnly prop is not working now which I was using earlier as well and its coming through react-native-video package

@mlazari
Copy link

mlazari commented Dec 9, 2024

@Shivangi2909
Copy link

Shivangi2909 commented Dec 9, 2024

@mlazari Any ideas on how we can make it work without patching the library or using a separate one for audio feature because even with 5.2.x version I am getting a different issue with latest RN version where this prop was working?

@mlazari
Copy link

mlazari commented Dec 9, 2024

@Shivangi2909 No, I think the only way would be to use version 5 of react-native-video and patch react-native-video-player 0.14.0

@github-actions github-actions bot removed the stale Closed due to inactivity or lack or resources label Dec 10, 2024
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

4 participants