react-native-jw-media-player icon indicating copy to clipboard operation
react-native-jw-media-player copied to clipboard

Fix/android chromecast

Open Jmilham21 opened this issue 1 year ago • 7 comments

This PR does:

  • Fixes / implements a workaround for Android Chromecast issues.
  • Fixes a session bug after initial reconfiguration. -- Removes MediaButtonReceiver from manifest as it's legacy code

Why this is necessary:

Intended to address this #314 issue

Additional information:

See my comment on the above issue for more context.

Jmilham21 avatar Jan 25 '24 19:01 Jmilham21

@Jmilham21 There is no Chromecast icon visible on the player to cast the video.

tara-singh-danu avatar Feb 08 '24 16:02 tara-singh-danu

@Jmilham21 There is no Chromecast icon visible on the player to cast the video.

@tara-singh-danu there has been a change in implementation of the cast module before the creation of this PR. By default, the bridge won't import the cast SDK. Follow the instructions in the updated README found on this PR to enable casting.

Jmilham21 avatar Feb 08 '24 17:02 Jmilham21

@Jmilham21 Followed each and every step mentioned in the readme still not getting cast icon. Screenshot 2024-02-08 at 10 43 04 PM

tara-singh-danu avatar Feb 08 '24 17:02 tara-singh-danu

The Example app in the project should work out of the box. Are you sure you are using the right branch? It works for me with no issues and multiple devices.

The device you are testing with may be incompatible with casting. You can check with the following Java code boolean isCastApiAvailable = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS;

Jmilham21 avatar Feb 08 '24 23:02 Jmilham21

@Jmilham21 I tried to run the android app on this branch(fix/android-chromecast) the app is not crashing and the icon is there but after casting the video, video is not playing on Chromecast device. I tested Youtube Chromecast is working on the phone and the Chromecast device.

tara-singh-danu avatar Feb 09 '24 14:02 tara-singh-danu

@tara-singh-danu This commit fixed the issue you are describing. If this change is implemented, the mismatch session IDs between sender and receiver should be resolved.

If it continues, check the logcat for anything interesting. Also, when testing with Chromecast, I highly recommend creating your own custom/styled receiver so you can inspect the web console.

Jmilham21 avatar Feb 09 '24 18:02 Jmilham21

Could this be reviewed? @chaimPaneth

Is there any idea when a release may have this incorporated?

paulrinaldi avatar Feb 27 '24 13:02 paulrinaldi

Is there any way to hide the cast icon completely for Android?

hideUiGroup: 'casting_menu', or hideUiGroups[ 'casting_menu'] or RNJWPlayerUseGoogleCast = false in gradle file do not seem to work for Android.

removing the Android dependencies for casting entirely is not a solution for me because they are used by another player...

Any response will be greatly appreciated.

fdobre avatar May 10 '24 14:05 fdobre