Jump to content

App tries to cast to Chromecast using the server's local instead of the remote address.


Hoptional
 Share

Go to solution Solved by Luke,

Recommended Posts

Hi!

I am running an emby server on a remote machine that is behind Cloudflare. Everything works fine until I try to cast to a chromecast device from my android app. The app connects to the chromecast, the chromecast says "ready to cast" but when I click play nothing happens. I went through the chromecast's logs and found that the it receives the LAN instead of the WAN address:
 

 

01-22 10:48:47.346  4478  4478 I chromium: [4478:4478:INFO:CONSOLE(441)] App ID: 2D4B1DA3 "Playlist message: {"type":"message","sc":false,"defaultPrevented":false,"kj":true,"senderId":"7525485c-c55a-97c3-5daa-db2b689bbcc2.270:com.mb.android-104","data":{"options":{},"command":"Identify","userId":"XXXXX","deviceId":"XXXXX","serverId":"XXXXX","serverVersion":"4.3.1.0","serverAddress":"http://172.29.0.2:8096","receiverName":"Casten Bier"}}", source: https://mediabrowser.github.io/Emby.Chromecast/components/maincontroller.js?v=1579686521316 (441)

 

127.29.0.2 is the local address in the docker container and the address that is displayed as LAN address in the dashboard. I censored my ids with XXXXX, as I don't know if they could be somehow abused.

 

Casting works fine when I use emby web with Google Chrome, so it seems to be a problem exclusive to the android app (I cannot try iOS).

 

My remote address is configured correctly and shows as https://emby.domain.com:443 in the dashboard. Is there anything I could do? Does anyone have the same problem?

Edited by Hoptional
Link to comment
Share on other sites

I would try configuring your network settings so that the server dashboard will display a reachable local address.

Link to comment
Share on other sites

Thanks for the reply! Reachable from where? The server is running on a remote machine, so I don't see how this would help with the android app not passing the remote address to the chromecast. Please correct me if I'm wrong.

Link to comment
Share on other sites

  • Solution

So then you'll want to configure the network settings so that the server is able to realize that the connections are remote.

  • Like 1
Link to comment
Share on other sites

I see. What criteria does the server use to determine whether the connection is remote or not when I use a reverse proxy? I do provide the X-Forwarded-For header but that doesn't seem to do the trick. It is also interesting that it works fine when i cast from Google Chrome.

 

Edit: Nevermind, I realized that I do in fact unset the X-Forwarded-For header (must be a leftover directive from when I was testing something). It works now, thank you for leading me in the right direction!

Edited by Hoptional
  • Like 1
Link to comment
Share on other sites

Thanks for the feedback.

Of course! I'm amazed with the level of support you provide.

 

Unfortunately, I have another Chromecast related problem, but this time it is not exclusive to the Android app but happens on Google Chrome, too:

Playback works fine if I start casting at 0 seconds, but it does not work when I want to start from any other point in the video. I see an image of the point where the video should start but the image freezes and nothing is played. The same thing happens when I skip forward or backward. In the server dashboard I can see that the playback position is reset to 0s whenever I skip somewhere, but the transcoding position is set correctly.

Link to comment
Share on other sites

Of course! I'm amazed with the level of support you provide.

 

Unfortunately, I have another Chromecast related problem, but this time it is not exclusive to the Android app but happens on Google Chrome, too:

Playback works fine if I start casting at 0 seconds, but it does not work when I want to start from any other point in the video. I see an image of the point where the video should start but the image freezes and nothing is played. The same thing happens when I skip forward or backward. In the server dashboard I can see that the playback position is reset to 0s whenever I skip somewhere, but the transcoding position is set correctly.

 

Check your If-Range and Range headers are being passed through the proxy.

  • Like 1
Link to comment
Share on other sites

Let's look at an example. Please attach the information requested in how to report a media playback issue:

https://emby.media/community/index.php?/topic/739-how-to-report-a-problem/

Thanks.

I attached the server-, transcode-, and chromecast logs. It works fine when direct playing, but not when direct streaming or transcoding.

 

 

Check your If-Range and Range headers are being passed through the proxy.

They should be configured correctly:

proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;

I also tried

proxy_force_ranges on;

but that didn't help either.

Thanks for the support!

 

Edit: let me know if I should open a separate topic for this issue.

Edit2: Discussion continues here: https://emby.media/community/index.php?/topic/79683-casting-from-mobile-to-shield-doesnt-work-well/page-2&do=findComment&comment=835487

chromecast.log

embyserver.txt

ffmpeg-transcode-8c8fd860-c227-48e4-a74a-439ddad68de4_1.txt

ffmpeg-transcode-342e74cc-72c8-4eca-8f8e-063aacbbc017_1.txt

Edited by Hoptional
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...