flo80 / MMM-chromecast

MagicMirror Module to cast from server to chromecast
MIT License
46 stars 3 forks source link

Using MMM-chromecast on an ubuntu-server instance #8

Open Z3roX opened 2 years ago

Z3roX commented 2 years ago

Is it possible to make the module able to to start the cast without using for example chome on the server? I dont have a gui, and all the headless solutions are only able to stream videos or mp3 formats and not the mm.

cobra0315 commented 1 year ago

Hi,

Please can anyone confirm if this addon still works? I have managed to use docker inside Synology to achieve access through https but still no luck.

If it does not work, I guess my best bet is to create another virtual machine and keep casting from inside the virtual machine? Any idea how would that affect power consumption compared with casting not through any host?

flo80 commented 1 year ago

Sorry for the late reply.

@cobra0315 I am not using MM anymore (device I used broke), so I don't really know if it still works. The APIs generally exist in chrome but Google regularly changes implementation details / security.

@Z3roX as far as I know, there is no way to start the cast without chrome. In the past, chrome was only required to start the cast but this might have changed (so Chrome always has to be running)

I will try to setup a VM in the next days to test this but will have to see, what devices I can find to test it.

Z3roX commented 1 year ago

@flo80 well I tried setting up a VM on my proxmox. Starting the cast via chrome, but as soon as I close the tab/browser the cast stops. I think the plugin does not "get" the needed information, as so it doesn't can connect through the plugin. I think the spec for casting may have changed?

Z3roX commented 1 year ago

@flo80 would be great if could find a way to get the plugin to work I such a configuration. Trying to get my smartmirror to properly work for long time.

flo80 commented 1 year ago

So I did some testing and reading documentation. The short summary is, this plugin does not work anymore.

To make it work, it would need to run in an https context (which afaik MM does not provide) and then register some handlers on the window object before loading a new google js framework (which you probably can do but only with some dom trickery). Then some adjustments are needed to use the new API google provides.

Sorry for the bad news! I think the easiest will be, to have a browser running somewhere which casts the tab. That's not a nice solution but as far as I can see the only really workable for the moment.

cobra0315 commented 1 year ago

@flo80 Thank you for the further investigation and sorry to hear the bad news.

I will probably cast the tab from the server that runs magic mirror once I setup my mirror.