react-native-jw-media-player
react-native-jw-media-player copied to clipboard
[Chomecast] Previous video gets played on the Chromecast device
Summary
The previous video is getting played on the Chromecast device. Happens on the latest version (0.2.34) and also on the older version 0.2.29.
Video recording of the issue is available here.
PS: I tried to reproduce this issue in a native Android project (no React Native) and couldn't reproduce it.
Reproduction Steps
You need to clone this repo and follow these steps:
- Click the button labelled "Playlist 1",
- Cast the video to your Chromecast device
- Stop the casting and press back button (to go back to the home screen)
- Click the button labelled "Playlist 2"
- Cast it to your Chromecast device. Notice that the video being played is not the current one but the previous video (the one from "Playlist 1").
Note: You will need to create a .env file with your JW Player keys. Please use .env.example as a reference.
Is there any fix for this @SufianBabri @chaimPaneth so much of time invested but no use with latest version also..can u fix it as it is the major roadblock for my app release?
@Udbhav24378 we ended up disabling JW Player's chromecast and using google cast library instead.
For this, you need to do the following things (can be found here):
- Apply the patch with patch-package
- For iOS, you will need to hide the Chromecast button.
@SufianBabri can u please let me know the steps for google cast sdk integration .. and implementation in jwplayer?
@Udbhav24378 just follow the docs.
hey @SufianBabri . have you managed by any chance to create a patch for disabling JW Player's chromecast for the latest version?
@grigdodon my project is using version 0.2.35 of react-native-jw-media-player dependency. Using for the newer versions shouldn't need to be much different. Does this patch cause any issues with the newer versions of this library?
@SufianBabri unfortunately not. I get:
**ERROR** Failed to apply patch for package react-native-jw-media-player at path
node_modules/react-native-jw-media-player
This error was caused because react-native-jw-media-player has changed since you
made the patch file for it. This introduced conflicts with your patch,
just like a merge conflict in Git when separate incompatible changes are
made to the same piece of code.
Maybe this means your patch file is no longer necessary, in which case
hooray! Just delete it!
Otherwise, you need to generate a new patch file.
To generate a new one, just repeat the steps you made to generate the first
one.
i.e. manually make the appropriate file changes, then run
patch-package react-native-jw-media-player
Info:
Patch file: patches/react-native-jw-media-player+0.2.35.patch
Patch was made for version: 0.2.35
Installed version: 0.2.39
And on version 0.2.35 the fullscreen events are not working, which I am using to control whether the player is playing or not.
@grigdodon I have updated the patch for version 0.2.39. Please test and update us if it works fine.
Any chance that this fullscreen events issue is not there in one of the older releases?
@SufianBabri oh you absolute legend! thank you! the fullscreen events stopped working in 0.2.35 and are working now in 0.2.39
hey @SufianBabri any chance you have the time to generate the patch for the latest version as well 0.2.43? thank you very much!
Hi @grigdodon. My apologies, I'm busy with a feature right now.
I can help you in creating a patch though. I have struggled in the past with updating patches and found these steps to make it much simpler. Hopefully, you'll find it helpful.
Just follow these steps:
- Install the dependency version that you want to patch
- Copy the contents of your old patch and paste them into the text area of diffy
- Now navigate to relevant files (as pointed out by diffy. You can reach your library folder at
node_modules/react-native-jw-media-player/
). - Once you've made all the changes, you need to create the patch file by executing
yarn create-patch react-native-jw-media-player
(if you're using npm, it's probablynpm run create-patch react-native-jw-media-player
). I've added "create-patch" and "postinstall" to my scripts block like this to my package.json:"scripts": { "create-patch": "npx --yes patch-package --exclude 'build/|xcodeproj'", "postinstall": "npx --yes patch-package" }
- If executing
yarn install
(for npm it'snpm i
) doesn't show an error specific to the newly created patch file, you can now delete the old patch file (make a copy of the old patch file just in case)