jellyfin-expo icon indicating copy to clipboard operation
jellyfin-expo copied to clipboard

Add Chromecast Support

Open anthonylavado opened this issue 4 years ago • 37 comments

AirPlay is natively supported, we just need to add the button in the controls in Web.

To make it a more complete client, Chromecast should be added, to finally give iOS users the option of using it.

A quick search shows that we might have to eject and use ExpoKit, so I'm unsure how to proceed.

anthonylavado avatar Nov 20 '19 21:11 anthonylavado

Maybe this would help: https://github.com/react-native-google-cast/react-native-google-cast/

brianclinkenbeard avatar Nov 30 '19 06:11 brianclinkenbeard

For reference:

https://forums.expo.io/t/chromecast-support/4699/2

https://expo.canny.io/feature-requests/p/support-for-chromecast

Apparently it’s been requested since 2017 with no movement, so we’d have to detach ☹️

anthonylavado avatar Dec 19 '19 08:12 anthonylavado

Old issue, but are there any current discussions on how to move forward on this? Not having Chromecast support on iOS is probably the only thing keeping me from migrating my users from plex/emby to Jellyfin.

If not, what workarounds are available?

krutburken avatar Jan 25 '21 09:01 krutburken

BUMP.

This is an important feature, and the only thing keeping me on Plex in absence of a dedicated client app for Raspberry Pi.

Coo-ops avatar Mar 24 '21 01:03 Coo-ops

This doesn't need to be bumped. That just adds extra noise and notifications that we have to deal with. Normally you could leave a thumbs up reaction on the top comment, or even upvote the feature request on our dedicated site: https://features.jellyfin.org/posts/466/chromecast-support-on-ios

We know it is in demand. Thornbill even pinned this just a few hours ago to show that we're aware of it.

It's still not possible yet for a variety of reasons that I've shared before on Reddit. I'll find those and post them here some time.

anthonylavado avatar Mar 24 '21 02:03 anthonylavado

Hey folks! Really interested in getting this feature figured out.

Just a quick note to add to the discussion - it appears when chromecasting from Plex for iOS, it actually initiates a cast via the Plex server's address (127.0.0.1:32400) to the device. Shouldn't Jellyfin be doing the same? The Jellyfin iOS app would ping the Jellyfin server for Chromecast devices, return the list to the iOS device, present them to the user, user chooses one to start the connection, then when content is played it's actually the server that is doing the Chromecasting.

I may be completely wrong here, just spitballing, so feel free to disregard. Thoughts?

jaredreich avatar Apr 28 '21 22:04 jaredreich

@jaredreich Almost, not quite. Say you are in a remote location, away from home. In that case, the server can't necessarily reach those devices on that network to cast ;-)

The way casting works (very, very simplified):

  • Client scans local network + Bluetooth for cast enabled devices
  • Client presents list of destinations to user
  • If user selects cast destination, start Cast session with App ID sent to Cast device
  • Cast devices gets App ID, checks with Google for application page (this is a website that we operate)
  • Cast page is loaded on device and session is connected to client (for media playback, etc).
  • User selects media, client sends URL and ID to Cast page
  • Page/Cast device sends request to server and starts playing back from there

anthonylavado avatar Apr 29 '21 03:04 anthonylavado

@anthonylavado thank you very much for the breakdown. Though I must still ask, shall we not implement this feature only because it won't work on an external network? I'd imagine a lot of users are casting at home while on the same network as the Jellyfin server right? Are there other reasons it can't be implemented other than not working from external networks?

jaredreich avatar Apr 29 '21 03:04 jaredreich

@jaredreich My apologies if that was the impression - there's other technical reasons why it's not there yet. I was just describing how the process works, and why just sending a session from the server isn't enough.

I realize I never fully explained the reasons here.

This app for iOS is written using a Javascript framework known as Expo. It's a special set of packages and a workflow based around React Native. The good part about Expo is they they make building apps very easy for both iOS and Android. They even take care of the build/compile process for you, so you can create an iOS app without owning a Mac (but you still have to have an Apple Developer Program membership). This is known as the "Managed" process.

The downside to Expo is that in most cases, you're limited to using packages and frameworks that they directly support. It's not possible to simply pull in whatever React Native package you'd want.

In order to add Chromecast playback, we need to add the Cast SDK in a supported way. One of those packages for React Native is linked towards the top, and I'm sure there's many others.

To have Expo include a package, you have to make a feature request, hope it gets their attention/enough votes, and then hopefully they include it. People have been asking for years now (see above again), and it hasn't happened yet.

Now you might be thinking - surely there's a way around this, right? Well, there is. The process is known as "ejecting to ExpoKit". This takes everything you've done as an Expo managed project, and converts it to a React Native project that happens to include some Expo modules. This adds a bit more complexity - builds must now be done on the correct platform. For example, the bundle for iOS would have to be compiled on a Mac, instead of just using Expo's servers. Though I have a Mac, I'm not the primary developer. Heck, I'm not really much a developer at all (my expertise is in other areas for Jellyfin, including "management"). My dear friend @thornbill has mostly been working on this from a Linux machine.

As it turns out, this year there are some things falling in to place that will make this transition easier, and we are getting closer to a solution, including ejecting and then adding on the modules we need.

Hopefully this helped explain it better 😄

Edit: Here's a link from Expo on the different "workflows" - https://docs.expo.io/introduction/managed-vs-bare/

anthonylavado avatar Apr 29 '21 03:04 anthonylavado

Expo just released a proof of concept on getting Chromecast working on Expo projects without having to eject: https://github.com/EvanBacon/prototype-config-plugins/tree/master/packages/react-native-google-cast

cuibonobo avatar Jul 02 '21 23:07 cuibonobo

Expo just released a proof of concept...

Yes, we got a notification about this since we have voted on the item. We're investigating.

Our other beta app, Swiftfin, does have Chromecast support in testing as well.

anthonylavado avatar Jul 03 '21 02:07 anthonylavado

Current version of the app has a Chromecast button but it can't find my Chromecast (it only shows my web browser on my computer and the DLNA device for my audio receiver): want a separate bug filed or is this one still tracking the ongoing effort? Edit: filed as https://github.com/jellyfin/jellyfin-expo/issues/309

edenman avatar Oct 08 '21 22:10 edenman

@edenman Yep, this is still the correct issue.

All - We are in the process of updating the Expo SDK we're using and will update if there's any more info to provide.

In the meanwhile, if you need Chromecast support, the Swiftfin beta client does have that integrated right now.

anthonylavado avatar Oct 10 '21 15:10 anthonylavado

Sounds good. And yeah, Swiftfin just unfortunately doesn't support external playback control https://github.com/jellyfin/Swiftfin/issues/177 so I'm sticking with Emby for the time being.

edenman avatar Oct 10 '21 17:10 edenman

Any more information on this?

salmi4k avatar Jan 05 '22 03:01 salmi4k

Any update?

bloodyburger avatar Jan 15 '22 12:01 bloodyburger

No updates on this yet. I will make sure to comment here when there is something to report.

thornbill avatar Jan 17 '22 05:01 thornbill

Expo have released Chromecast support!

JefCarlier avatar Apr 14 '22 21:04 JefCarlier

Yes they did... kind of. It's not implemented as one of their standard packages, but uses their relatively new "config plugin" system. Using these new plugins requires you to build native code which requires a Mac for iOS. This defeats my whole reason for using Expo which allows me to develop for iOS from my normal Linux computer.

Personally I don't see any benefit in using Expo vs standard React Native given this is the direction things seem to be going. Hopefully at some point this year I will pickup a Mac that I am able to develop from and I can move forward with ejecting from Expo to React Native proper.

thornbill avatar Apr 26 '22 13:04 thornbill

I'm not familiar with Expo but is it feasible to develop the Chromecast support locally on Linux and rely on macOS CI/CD machines to build, test and deploy the app?

GitHub Actions have a macOS runner but consume minutes at a 10x rate.

dkbnz avatar May 10 '22 10:05 dkbnz

Hey I have a Mac and I'm a dev, I don't have much experience with Expo, but I can help with building and do the testing just need some help to know what I should be looking at. So I can help if the only thing needed to avance with this feature is a Mac. I successfully build the application and added de plugin it still no showing my chrome cast but it's a good start.

FerMPY avatar Jul 19 '22 00:07 FerMPY

Any Update?

rbnmrz318 avatar Feb 25 '23 21:02 rbnmrz318

This is still a critical feature for mass adoption.

Skyl3lazer avatar Sep 26 '23 01:09 Skyl3lazer

@thornbill Is there any update on the likelyhood of this? Was very annoying to spend ages setting up my instance to discover my wife cannot cast to any of our TVs.

I have a Mac and while have not worked on Expo before, am willling to take a look at how this could be implemented with the config plugin system.

citric-code avatar Dec 13 '23 10:12 citric-code

No. See this comment for details. Using the Expo plugin system would remove my ability to develop for or maintain this app.

thornbill avatar Dec 13 '23 13:12 thornbill

Any update for this? Would love to see Chromecast support in IOS :)

SvenTheBoyy avatar Jan 03 '24 18:01 SvenTheBoyy

When will we probably use Chromecast on iOS clients?

weiyideai520 avatar Jan 04 '24 02:01 weiyideai520

For anyone interested, i am using the "infuse" App on iOS to connect my jellyfin instance and stream to my Chromecast. Unfortunately, Infuse does not have any rendering options, so when i am on the go i am using the native jellyfin app. Infuse is at a yearly subscription of 15€

rbnmrz318 avatar Jan 13 '24 11:01 rbnmrz318

Maybe consider a rewrite in Flutter. I’ve tried it and works well. I see some cast plugins for flutter. Although I have not tried them.

ajbastien avatar Feb 17 '24 14:02 ajbastien

In addition to having absolutely no personal interest in learning Flutter, rewriting in Flutter solves none of these issues.

The main blocker is just that I lack access to a modern Mac to develop on and both ejecting to vanilla React Native or using Expo's native plugin system would require building on a Mac.

thornbill avatar Feb 17 '24 23:02 thornbill