d8ahazard / Cast.bundle

A Plex Channel To Interact With Local Cast Devices, Via Plex Media Server
59 stars 11 forks source link

Does Flex TV work is the Plex server in a different location? #14

Closed brimur closed 6 years ago

brimur commented 6 years ago

A stupid question? I am running Flex TV in a docker container on my NAS at home where my TV and Chromecast are but my Plex server is in my parents house so using the cast.bundle obviously doesn't find anything and so Flex TV cannot find my Chromecast. It worked fine in v1 because I was able to assign a static device but that is gone in v2 (at least I cant find it). Is there a workaround for this? I only have one Chromecast I want to use so I dont need a scanning ability, I just want to tell it the ip of my CC to make the "call home"

d8ahazard commented 6 years ago

Spin up a Plex server at the physical location where you live, use it just for hosting the plug in...

On Fri, Jul 6, 2018, 11:01 AM brimur notifications@github.com wrote:

A stupid question? I am running Flex TV in a docker container on my NAS at home where my TV and Chromecast are but my Plex server is in my parents house so using the cast.bundle obviously doesn't find anything and so Flex TV cannot find my Chromecast. It worked fine in v1 because I was able to assign a static device but that is gone in v2 (at least I cant find it). Is there a workaround for this? I only have one Chromecast I want to use so I dont need a scanning ability, I just want to tell it the ip of my CC to make the "call home"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/d8ahazard/Cast.bundle/issues/14, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjuNFxHpMk8QCdZOiTAqjejWNNmDuDtks5uD4m7gaJpZM4VFruz .

brimur commented 6 years ago

Thanks. I tried and it found my Chromecast but it will not play anything, it starts to load but eventually always says "Sorry, something went wrong" I tried adding media to the local server and get the same message. Both do work using the Plex apps or webpage. Maybe a change in the new version of the Plex for Chromecast app that came out recently?

CornHead764 commented 6 years ago

Has anyone found a resolution/work around to this? I too have a remote plex server with a local one for the cast app, and am getting the "Sorry, something went wrong" message when attempting to cast.

CornHead764 commented 6 years ago

As an update to this. I have found through digging in the logs that the final HTTP GET url is being built wrong when using a plex server dedicated for the cast bundle, while the plex server with the media is remote. The url should look something along the lines of:

http://(local_server_ip:32400)/chromecast/play?X-Plex-Token=whatever&X-Plex-Clienturi=(cast_device_ip:8009)&X-Plex-Contentid=(content_info)&X-Plex-Contenttype=video&X-Plex-Offset=0&X-Plex-Serverid=(remote_server_with_media_ID)&X-Plex-Serveruri=http%3A%2F%2F(remote_server_with_media_IP)%3A32400&X-Plex-Serverversion=(current_version)&X-Plex-Username=(your_username)&X-Plex-Queueid=(Queue)&X-Plex-Transienttoken=transient-whatever

The problem seems to be that when asking phlex to stream something from a remote device to a local chromecast through a local plex server with the plugin, it builds a request similar to below:

http://(local_server_ip:32400)/chromecast/play?X-Plex-Token=whatever&X-Plex-Clienturi=(cast_device_ip:8009)&X-Plex-Contentid=(content_info)&X-Plex-Contenttype=video&X-Plex-Offset=0&X-Plex-Serverid=(local_server_ID)&X-Plex-Serveruri=http%3A%2F%2F(local_server_ip)%3A32400&X-Plex-Serverversion=(current_version)&X-Plex-Username=(your_username)&X-Plex-Queueid=(Queue)&X-Plex-Transienttoken=transient-whatever

(notice local server ID and IP is included where the server with the media's ID and IP should be)

This is essentially telling your local plex server to play content to the chromecast from itself, giving the media location from the other server, but telling the server it's on the local server. From what I can tell, it should just need to be modified to build the request using the server ID and IP of the server the media was found on. If the request is generated that way, it should resolve the "Sorry, something went wrong" problem.

@d8ahazard

d8ahazard commented 6 years ago

Gotcha. Let me see if I can replicate this with my buddy's server and find the right place to fix this. I suspect this is going to require a fix to Flex TV, not the plugin. I could be wrong. I'll get back to you in a few hours...

d8ahazard commented 6 years ago

@CornHead764 This has been fixed in revision 486ef27.