Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Jellyfin cannot stream to Chromecast #79

Open
mazzystr opened this issue Feb 6, 2019 · 33 comments
Open

Jellyfin cannot stream to Chromecast #79

mazzystr opened this issue Feb 6, 2019 · 33 comments
Labels
bug Something isn't working casting Issues with Google Cast

Comments

@mazzystr
Copy link

mazzystr commented Feb 6, 2019

I'm having trouble getting Jellyfin to stream to Chromecast. I get an Emby status screen on my television when I start casting media.

Here are my versions...

Router: OpenWrt 18.06.1
Mobile app: Emby for Android Mobile 3.0.27
Server: Jellyfin Version 10.1.0
Podman: podman version 0.11.2-dev
Container: binhex/arch-jellyfin... I should probably start using the official container in the Docker repository.
Iptables on my host has ACCEPT policies on all tables and all:all:all on the network->container rules.

The podman command is the following...

podman run -d --name jellyfin --hostname jellyfin --ip 172.30.0.100 -p 1900:1900/udp -p 8096:8096/tcp --name=jellyfin -v /etc/localtime:/etc/localtime:ro -v /mnt/media:/media -v /mnt/daemons/jellyfin/:/config -e UMASK= -e PUID=666 -e PGID=666 binhex/arch-jellyfin

I also tried using mobile app jellyfin-android_release_beta2. That app doesn't see the Chromecast at all.

@anthonylavado
Copy link
Member

Hey there! 👋

Can you tell us if your server is set up with HTTPS at all?

Also, the original Emby app won't cast from Jellyfin - they added a block a while ago. Even though you have the older version of the app, the Cast app is a web page that's loaded from the internet.

@mazzystr
Copy link
Author

mazzystr commented Feb 7, 2019

re jelly fish app ... The Chromecast doesn't even show up in the cast list. Other dlna devices such as SONOS speakers do show up. The Chromecast shows up in Plex without an issue.

re https ... I don't currently have it enabled. My internal network has been using .local fqdns where .local is provided by dnsmasq on the OpenWRT router. I don't think there's an easy way to change without major rework of the router, hosts and apps. Plex has been casting over unsecure http for ever.

re original Emby app and casting ... Arg... Bastards!

@anthonylavado
Copy link
Member

Hey again. We're looking into this as part of a bigger search on cast instability, because the app should work.

Regarding Secure/Unsecure: The HTTP situation recently changed. We've discovered that ourselves, and it's happened to others.
References:
jellyfin/jellyfin#791
https://emby.media/community/index.php?/topic/69363-chromecast-problem/?p=695078
https://forums.plex.tv/t/cast-api-is-not-available-in-chrome-72/365280

@wjbeckett
Copy link

wjbeckett commented Feb 11, 2019

@anthonylavado, So I found out how to reproduce the Chromecast not appearing in the list when you click the cast button and also how to resolve it.

If you open the JellyFin app and click cast, I only see my phone listed. However, if I turn off WiFi and then click cast the app refreshes and I can discover my Chromecast. If I then switch back to WiFi and click cast button again, it refreshes and I can see the Chromecast.

So it looks like the app needs to scan for Castable devices and switching networks forces the scan.

I notice the same behaviour in Plex, however Plex has the refresh button to initiate the scan.

So perhaps all that is needed is to implement a "refresh" button in the cast to list to force the app to scan for Cast enabled devices.

Once I can see the Chromecast, experience is perfect. It's just getting that initial scan done.

@anthonylavado
Copy link
Member

@wjbeckett - that would explain my workaround of locking the device, waiting, then trying again. It’s probably my test device putting the Wi-Fi to sleep, then waking up and scanning again.

I’m certain there’s gotta be some kind of timeout we can adjust for something like this, but I don’t know the Android/Casting plugin well enough to know for sure. I know that whatever our next client is in, it won’t be this legacy app that we’re patching to work - so the experience will be much better.

@wjbeckett
Copy link

@anthonylavado I was thinking that the refresh should be called when the cast button is pressed (when it's not currently active). That way, the list is always up to date. But also have a time-out on it so the refresh call isn't spammed.

I've been wanting to start learning Android app development using Kotlin but I don't have the time right now. Otherwise I'd love to help build a new app from scratch. Maybe one day.

@joshuaboniface
Copy link
Member

joshuaboniface commented Feb 11, 2019

I totally agree with that - I assumed it was doing so anyways.

@cvium
Copy link

cvium commented Feb 12, 2019

In Chrome macOS the cast API is unavailable in insecure contexts and no amount of scanning fixes that. I'm not sure what you're proposing will do anything.

@anthonylavado
Copy link
Member

@cvium They mean in the mobile app. The mobile app seems to be kind of jittery in that it sometimes needs to “re-scan” for a Chromecast.

@cvium
Copy link

cvium commented Feb 12, 2019

Does the mobile app not need a secure context? Or is an app automatically considered a secure context?

@anthonylavado
Copy link
Member

@cvium Just caught up to this - the mobile app works outside of these other boundaries. I believe it's because it uses the on device libraries to do it, so it's not related to the way the browser handles it. For examples, in Emby's app, with an unsecured server, it still works.

@thornbill thornbill added the bug Something isn't working label Feb 16, 2019
@anthonylavado
Copy link
Member

Many issues are likely to be fixed by jellyfin-archive/cordova-plugin-chromecast#7

@tyhawk
Copy link

tyhawk commented Apr 6, 2019

Not sure if this is the same issue, but I am unable to stream to Chromecast from my phone using the most recent android app (jellyfin-android_release_beta8.apk) and the current Jellyfin server (running inside docker.
I can play movies on my phone, but as soon as I connect to Chromecast, playback stops and the TV shows its connected to Jellyfin.
If I first connect to the Chromecast and then navigate to a movie, the play button no longer works and I can't start it.

@viggy96
Copy link

viggy96 commented May 9, 2019

I have the same issue as @tyhawk. I can connect to my Android TV with the Chromecast button in the mobile Jellyfin app, but I can't start any media playback.

@tyhawk
Copy link

tyhawk commented Jul 16, 2019

I can't speak for anyone else who reported this issue, but the 0.9.1 release solved the issue for me. I am now able to cast to my chromecasts without any issues.

@axllent
Copy link

axllent commented Jul 19, 2019

0.9.1 isn't working here. Once connected to the chromecast, the play button does nothing.

@warllo54
Copy link

warllo54 commented Jul 22, 2019

Seeing this as well. "0.9.1 isn't working here. Once connected to the chromecast, the play button does nothing."

I am running Jellyfin using docker, I am using traefik as a reverse proxy. Here is my docker compose file with certain info redacted.:

jellyfin:
image: jellyfin/jellyfin
container_name: jellyfin
environment:
- PUID=1008
- PGID=1008
ports:
- 10550:8096
networks:
- web
volumes:
- /data1/services/jellyfin/config:/config
- /data1/services/jellyfin/cache:/cache
- /mnt/multimedia:/media
labels:
- "traefik.enable=true"
- "traefik.backend=jelly"
- "traefik.frontend.rule=Host:jxxx.xxx.xxx"
- "traefik.frontend.headers.SSLRedirect=true"
- "traefik.frontend.headers.STSSeconds=315360000"
- "traefik.frontend.headers.browserXSSFilter=true"
- "traefik.frontend.headers.contentTypeNosniff=true"
- "traefik.frontend.headers.forceSTSHeader=true"
- "traefik.frontend.headers.STSIncludeSubdomains=true"
- "traefik.frontend.headers.STSPreload=true"
- "traefik.frontend.headers.frameDeny=true"

@anthonylavado
Copy link
Member

Just to follow up for others here, we'll need to know some more details, such as how Jellyfin is installed (docker?) and if you have a reverse-proxy set up.

As discovered in jellyfin/jellyfin#1396, it seems there's issues if the Chromecast doesn't know how to reach your server. There are some possible solutions in that thread. I would try this workaround:

  • Go to Dashboard>Advanced
  • Check ✅ "Allow remote connections..."
  • Uncheck ⬜️ "Enable automatic port mapping"
  • Find the field "External domain", and set your Jellyfin LAN IP

@dkanada
Copy link
Member

dkanada commented Jul 24, 2019

I am actually in the group that has no Chromecast functionality now, despite this issue getting fixed for others. I would look into it more, but my debugging is limited since I don't own the device.

I think there are two main issues here.

  1. The library we use isn't always getting initialized so the list can be blank.
  2. There are several code paths that lead to a repeated dialog creation.

This is the dialog getting called, and this is where I believe the request is getting repeated. There is also an autoconnect variable in the library that looks suspicious but the aforementioned section looks more probable. This is an annoying issue to debug mainly because the code spans three repos (web, android, and the chromecast library) and testing changes is hard without a device.

@Artiume
Copy link
Contributor

Artiume commented Jul 24, 2019

To give some more information on some of the people who are having issues. Chromecast is dependent on uPnP. When using docker and you don't use the host network, this creates a NAT barrier between the chromecast and the container. uPnP doesn't work well across NATs and I think this is the issue people are having, I don't think it's a jellyfin issue with the people who are not using host network with docker. I saw one person using podman, I'm yet to look into podman so I don't know if their situation is the same.

@smoebody
Copy link

@Artiume i cannot confirm that. i used emby for months without upnp and i had no issues streaming to chromecast.
After switching to jellyfin i have the same issue described here: can choose the chromecast but pushing the play-button does nothing.

i compared the system.xml of emby with the system.xml of jellyfin and i found, that emby has the following elements:

<ServerName>emby.example.com</ServerName>
<WanDdns>emby.example.com</WanDdns>

which jellyfin has not. just copying them over did not help unfortunately.

Also the "workaround" @anthonylavado mentioned sounds promising, but i cannot find the "Advanced" tab in the dashboard or any "External Domain" field.

@Artiume
Copy link
Contributor

Artiume commented Nov 24, 2019

So I think you might be right. the upnp requirement comes into play when it's device to device. I don't think the server being in the multicast range is important. Otherwise sites like yt wouldn't work with chromecast.

https://support.google.com/chromecast/answer/3213086?hl=en-CA

I'm running 10.4.1 in docker with traefik reverse proxy. I found the Advanced section towards the bottom of the dashboard in the 'Expert' section. This Path should take you there directly.

http://yourjellyfinurl/web/index.html#!/dashboardhosting.html

@JustAMan
Copy link
Contributor

I tried using my Samsung Internet Browser and it was not able to find any devices.

I think that the way Chromecast is implemented you have to either use Chrome browser (not even Chromium, as that part is only built in proprietary Google build) or our app (or other Chromecast-enabled apps). Any other browser won't let you do the thing, at least that's what I read/heard.

@smoebody
Copy link

FTR chromium is working, but manual adjustments in chrome://flags/#load-media-router-component-extension to enabled is necessary.

@Artiume thanks for the hint to the advanced-section - i have it also.

What i don't have is the field "External domain" as stated by @anthonylavado .

I think the entire networking-thing of emby - and therefore inherited by jellyfin - is design-broken. there are issues on jellyfin that suggest this as well. jellyfin/jellyfin#1396

@viggy96
Copy link

viggy96 commented Nov 26, 2019

@smoebody I changed 'Secure connection mode' back to 'handled by reverse proxy' and disabled automatic port mapping, and chromecasting started working again.

@JustAMan
Copy link
Contributor

I think the entire networking-thing of emby - and therefore inherited by jellyfin - is design-broken. there are issues on jellyfin that suggest this as well. jellyfin/jellyfin#1396

It certainly is, especially that drop-down of "secure connection mode". We didn't have volunteers fixing this up yet, though :(

@owenashurst
Copy link

I'm experiencing this all the time now, before it was intermittent. Running the latest version of jellyfin in docker with an nginx reverse proxy setup with SSL.

@owenashurst
Copy link

@smoebody I changed 'Secure connection mode' back to 'handled by reverse proxy' and disabled automatic port mapping, and chromecasting started working again.

This worked for me with jellyfin running in a docker container, thanks!

@owenashurst
Copy link

Seems like on the newest build there's is no option for "secure connection mode" anymore which has broken casting again.

@dkanada
Copy link
Member

dkanada commented Aug 2, 2020

Nothing has changed internally, it was just an interface tweak. Enabling HTTPS is functionally the same thing as the previous select menu but easier to understand.

@owenashurst
Copy link

owenashurst commented Aug 2, 2020 via email

@dkanada
Copy link
Member

dkanada commented Aug 2, 2020

In that case you would just disable HTTPS for Jellyfin and let the reverse proxy handle it normally.

@thornbill thornbill added the casting Issues with Google Cast label Aug 12, 2020
@h0od
Copy link

h0od commented Aug 17, 2020

Seeing that the latest comments here are just a couple of weeks old, I'd like to refer to this issue

I started having issues with Chromecast recently. In my particular case, I found a quick fix. See my comment in the linked issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working casting Issues with Google Cast
Development

No branches or pull requests