mMusicCast icon indicating copy to clipboard operation
mMusicCast copied to clipboard

Is this a hack?

Open VanCoding opened this issue 7 years ago • 4 comments

I've been waiting very long for something like this to happen, but I always thought it was not possible to create a custom chromecast receiver and that Google locked down the API to prevent people from creating competing products.

I also thought that's why PiCAST does not act like a real chromecast, or why cheapcast had to stop.

But you did it, which leads me to the question: Is this a hack? Or was the API never locked down as I assumed?

Another question that comes to mind is: Why does it not automatically support all apps that chromecast supports, or, why do you have to support each app on its own? Isn't chromecast just a platform where apps can run their "receiver app" on? Or does google have to update their chromecast devices for every new app it supports?

I'd really like to find out more about how all of this works and what's the current situation. Do you mind to give me a short enlightenment on this?

If not, big big thanks to you anyway, as this is a huge step towards an open chromecast platform :)

VanCoding avatar Sep 11 '18 09:09 VanCoding

Hi Patrik, Long story short, yes it is a hack. It's based on chromecast v1 protocol reverse engineering close to youtube app. The way chromecast loads applications is very basic, it just loads a webpage either from internet or hosted on the connected phone. The case with youtube was a webpage that communicates on websockets with the chromecast to pair with the device, It's called youtube tv and is present on playstation, smartTvs, etc. From the chromecast protocol I took only the parts used to be discoverable than when youtube initiated the connections, just loaded the youtube tv app. With spotify for example I had issues to to the app expecting a chromecast v2 enabled device. PiCast is just a simple app that tries to copy chromecast but not to be compatible with the protocol. There are a lot of things that can be done to improve this and make it work with v2 also. Unfortunately I don't have the time to continue now. I'll probably add more things as time passes and I have another free evening like the one that resulted in this project.

vbaicu avatar Sep 17 '18 18:09 vbaicu

Ok, thanks :)

So, if I understand it correctly, if mMusicCast would advertise itself as a chromecast v2 device, it would show up in every app that supports chromecast (including netflix, google music, spotify etc), and the reason why it currently does not is because it currently advertises as v1, and the mentioned apps need v2, right?

If yes, this leads to the question, if an application that advertises itself as a chromecast v2 device can even be created, or if google locked down the api with v2 and you need a key or something to act as such a device.

VanCoding avatar Sep 19 '18 10:09 VanCoding

According to https://github.com/thibauts/node-castv2, it's not possible to act as a chromecast v2 device, because it would require googles private key.

VanCoding avatar Sep 19 '18 11:09 VanCoding

Actually it's pretty nice even just for Spotify alone. I wasn't able to have youtube work, but that's not a problem. My main goal would be to have something similar as a chromecast audio installed on my PI, connect to Google Home, and add it to my multiroom spotify speaker list.

Was not able to do it, but after seeing spotify accepts and plays music on it, after all that failures with different software and methods, it was kinda relief, thanks @vbaicu for the hope ;)

hgghyxo avatar Jan 24 '19 17:01 hgghyxo