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

Add ExpandedController to chromecast usage #106

Merged
merged 12 commits into from
Sep 1, 2024

Conversation

jakequade
Copy link
Contributor

@jakequade jakequade commented Aug 24, 2024

Love your work, and this incredible library. Great job!

In good faith, I wanted to offer some chromecast functionalities. I noticed it wasn't on the roadmap, I hope this is okay :)

  • Implements ExpandedController when chromecast play button variant is pressed, allowing for scrubbing of media.
  • Patches an issue where pressing the play button while chromecasted content is already playing causes it to restart. Now, it checks against titles and does not restart if the titles are the same.
  • Modified the websocket call to consider insecure network paths

Note: extending the androidmanifest.xml was done by way of this suggested post

Thanks again for this great app, happy to help / change anything as requested. This has been tested on Android using a Samsung Galaxy S21. I'm not able to test on iOS unfortunately, hopefully it plays nicely with the existing config option

@fredrikburmester
Copy link
Owner

Amazing! Thank you for this contribution 😁

@fredrikburmester
Copy link
Owner

@jakequade Just to double check, this is for android only right? Is it possible to create a similar plugin for iOS, in a similar way?

@jakequade
Copy link
Contributor Author

jakequade commented Aug 24, 2024

@fredrikburmester it should work for iOS given the app.json setting for iOS linked above (sorry, on my phone atm). Happy to test it out and confirm once I'm back at keyboard in a couple hours. I did try get the build running on an ios device but had different xcode minimum target deployment ranges.

@fredrikburmester
Copy link
Owner

The existing app.json implementation is not working as far as i know. I don't think that setting is supported in the expo config. I opened an issue here: react-native-google-cast/react-native-google-cast#538

@jakequade
Copy link
Contributor Author

@fredrikburmester I've pushed a patch that injects the ios appdelegate code via a mod. I've had intermittent app signing issues when testing (generated xcode project doesn't like that my iphone isn't part of your expo team's signing config), so if you're able to test it that would be awesome. Alternatively I can send you my device guid and I could try running the eas build once you've provisioned it.

@fredrikburmester
Copy link
Owner

You can probably just remove the id from the config and that'll solve the signing issues! Not exactly sure but it worked for another contributor.

@jakequade
Copy link
Contributor Author

@fredrikburmester nice - you're right, not rebuilding the ios directory had tripped me up. I've just tested on an iPhone 13 and it works the same as android. Scrubbing works, also has buttons for volume and captions.

@jakequade
Copy link
Contributor Author

IMG_0019

From iPhone. The interface isn't the prettiest, but it's a starting point (I would have thought the background would be populated by the cast lib).

@fredrikburmester
Copy link
Owner

Wow that's a great looking interface! Last time I used the extended controls it did not look that great. Did you create the interface just now?

@jakequade
Copy link
Contributor Author

jakequade commented Aug 24, 2024

Nope, it's just the default ExpandedController as far as I'm aware - source. :) glad it looks okay.

Edit: I've noticed some buffering issues intermittently with this change, I need to look into them a bit further.

@MajorP93
Copy link

Looks very promising! Thanks for the contribution!

I am also very much interested in having scrub controls working when streaming to Chromecast.

Any updates on the buffering issues @jakequade ?

@jakequade
Copy link
Contributor Author

@fredrikburmester apologies for the delay, no good excuse. I've found the source of the buffering issues, latest commit removes an additional play function call. This works as expected now, happy for you to have a look if you're able :) cc @MajorP93

@fredrikburmester
Copy link
Owner

Thank you, no worries at all! Will check it out as soon as possible.

@fredrikburmester fredrikburmester merged commit 10e0a45 into fredrikburmester:master Sep 1, 2024
1 check passed
@jakequade
Copy link
Contributor Author

Damn, great work on the metadata changes - it looks so good on the testflight version! Works a charm. Thanks so much for everything. Might have a poke around the needs help issues.

@fredrikburmester
Copy link
Owner

No, thank you! 🔥 the expanded controls are great!

Might have a poke around the needs help issues.

That would be amazing!

@fredrikburmester
Copy link
Owner

@jakequade This just got released: https://github.com/react-native-google-cast/react-native-google-cast/releases/tag/4.8.3

Should we change our implementation to use this or keep the current one? What do you think?

@fredrikburmester
Copy link
Owner

@jakequade if you want, please join our discord so we can discuss more!

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

Successfully merging this pull request may close these issues.

3 participants