[RELEASE] cast-web v1.2.1 - Chromecast Integration (EDGE Driver discussion begins in post 1668)

I created 3 presets 1 for a classic MP3 station to wake up to, an 80’s mp3 station and a Youtube playlist for #3. The two mp3 stations work fine but I cannot get the Youtube to work at all. Do you have any suggestions on how I can get the preset #3 to work?

{“preset1”:{“mediaTitle”:“Wake Up”,“mediaSubtitle”:“Good Morning”,“mediaType”:“JPG”,“mediaUrl”:“http://37.251.146.169:8300/stream;.mp3",“mediaStreamType”:"{mediaStreamType}",“mediaImageUrl”:“https://lh3.googleusercontent.com/WxW9gmuOJGPLdI33C4RpfBC5zXJbwcm_-chXRTQVcrhGHP0od4_-F_mqAgjytDf2-22889WG7uDXSw=w404-h402-rw-no”},“preset2”:{“mediaTitle”:"80s Rock”,“mediaSubtitle”:“Hello 80s Rock”,“mediaType”:“JPG”,“mediaUrl”:“http://149.56.23.7:20120/stream;.mp3",“mediaStreamType”:"{mediaStreamType}",“mediaImageUrl”:“https://lh3.googleusercontent.com/WxW9gmuOJGPLdI33C4RpfBC5zXJbwcm_-chXRTQVcrhGHP0od4_-F_mqAgjytDf2-22889WG7uDXSw=w404-h402-rw-no”},“preset3”:{“mediaTitle”:"Girls Wake up”,“mediaSubtitle”:“Good Morning Makayla & Sophia”,“mediaType”:“JPG”,“mediaUrl”:“https://www.youtube.com/embed/videoseries?list=PLgVXsAwsMZqXE1WIYnRZgZqwm5ZRQKmeJ",“mediaStreamType”:"{mediaStreamType}",“mediaImageUrl”:"https://lh3.googleusercontent.com/WxW9gmuOJGPLdI33C4RpfBC5zXJbwcm_-chXRTQVcrhGHP0od4_-F_mqAgjytDf2-22889WG7uDXSw=w404-h402-rw-no”}}

Youtube is difficult. Right know it’s not supported and I’m not sure if it’ll ever be supported. The bottleneck here is the API. The cast protocol would require the YouTube Receiver to be launched, which only YouTubes mobile and web apps can do. Couple of months ago I stumbled upon a open source implementation of that receiver. I’ll consider implementing that in the future and add it as a future feature on GitHub! :slight_smile:

See: https://github.com/vervallsweg/cast-web-api/issues/47

1 Like

Is a parameter error. All of your presets miss one parameter that is mediaImageUrl. After I added an image url to it, the cast devices reacted. However some of the stream url’s where not the actual stream but just a container. I corrected those streams for you.

{"preset1":{"mediaTitle":"Toker.FM","mediaSubtitle":"מוסיקה יהודית 24 שעות ביממה","mediaType":"audio/mp3","mediaUrl":"http://178.33.191.197:6062/;stream/1","mediaStreamType":"LIVE","mediaImageUrl":"https://lh3.googleusercontent.com/376_3cAV4fQWxOT2i0xVKBCpRb3Ju-BFQPnd5rnGHSHIy7ddFkX_oQBq2DD1B9mfwWk=w300"},"preset2":{"mediaTitle":"JRoot","mediaSubtitle":"The Jewish Station that Listens to You!","mediaType":"audio/mp3","mediaUrl":"http://184.154.202.243:8306/stream;.mp3","mediaStreamType":"LIVE","mediaImageUrl":"https://static-media.streema.com/media/cache/21/ba/21bac33ee8c1e5873d2b9fe099ca3abd.jpg"},"preset3":{"mediaTitle":"Kol Berama","mediaSubtitle":"NY Jewish Music","mediaType":"audio/mp3","mediaUrl":"http://173.193.205.96:9016/;stream/1","mediaStreamType":"LIVE","mediaImageUrl":"http://www.theyeshivaworld.com/wp-content/uploads/2017/03/Capture-13.png"},"preset4":{"mediaTitle":"Preset 4","mediaSubtitle":"","mediaType":"","mediaUrl":"","mediaStreamType":"","mediaImageUrl":""},"preset5":{"mediaTitle":"Preset 5","mediaSubtitle":"","mediaType":"","mediaUrl":"","mediaStreamType":"","mediaImageUrl":""},"preset6":{"mediaTitle":"Preset 6","mediaSubtitle":"","mediaType":"","mediaUrl":"","mediaStreamType":"","mediaImageUrl":""}}

Enjoy! :slight_smile:

PS: Everything is Hebrew capable, which I didn’t expect.

1 Like

Good that it works for you know. Was about to point you to other apps and documentations anyways, since I have never tried using njs on an android device.

I have some problems with instructions for installing the API from the article you posted. I never posted that it should be installed that way and the npm package (for now) is deprecated. With those instructions you end up with an outdated version of the API that’s impossible to upgrade.

If you can do it on your own, I’d recommend you get the source code for the API from GitHub and run it directly, as described here.

I’m investigating that. Which version of the API are you running?
You can check by opening http://{API address}/config?get=version

I was wondering if I can install all the apps and DH for the get hub repo integration in smartthings. If so what is the name, owner, master.?

1 Like

Yes you can.

Owner = vervallsweg
Name = smartthings
Branch = master

5 Likes

Nevermind, I found my mistake: I’m running cast-web-api inside a Docker container and I’d simply forgotten to install castv2-client, so I was able to control the cast devices but custom playback wouldn’t work.

If someone is interested, here is the (corrected) Dockerfile:

FROM node
RUN npm install cast-web-api castv2-client
EXPOSE 3000
CMD ["node","/node_modules/cast-web-api/castWebApi.js"]

This is the response I get:

{“response”: “ok”, “version”: “0.2.2”}

Does that make sense, or is it supposed to say 0.1?

@Buzzshot yes should work, cannot try it though since I live in Europe and thanks @aniceberg for pointing it out! :slight_smile:

@janw Looks like a bug that was fixed in 0.2.1 already.
It seems like you got the package from npm directly, not from GitHub. The npm package is abandoned (at least for now). In version 0.2.2, which you can get from GitHub, you have working dependencies and more bugfixes.

Yes makes perfect sense and you’re running the latest version of the API. Have the same problems that @janw had, or casting from ST works fine?

Thanks, everything is working fine!

So im pretty new to all this, but i figured most of it out. on the pc thats running the node.js, the web server seems to work on it. but i cant get anything to show up on the smartapp. i changed the localhost but i dont know if i changed it to the right address or name. is there something im doing wrong there?

You need to change the hostname to the IP address of your computer (that runs node.js). Localhost as a hostname will not work. You need to look that up in either your computers network settings, or your router.

After you did that, try accessing it by entering http://{your-ip-address}:3000 into your browser.

Oh and I hope you’re using the official guide, other ones on the internet seem outdated.

Any suggestions on how to get this to run at startup? I’ve tried using the following link to configure, but I can’t get it to work. (I was able to get it to work on another node service). http://www.instructables.com/id/Nodejs-App-As-a-RPI-Service-boot-at-Startup/

Thanks for the hint; using the version from Github now:

FROM node
WORKDIR /cast-web-api
RUN git clone https://github.com/vervallsweg/cast-web-api.git . && npm install
EXPOSE 3000
CMD ["node","/cast-web-api/castWebApi.js","--hostname=0.0.0.0"]
1 Like

Can I run this on a server to integrate a dlna service with Google home in some fashion?

Is there a docker image I could use to run everything I need in a container?

My Raspberry Pi is running “mission critical” services (aka DSC alarm integration to ST) and I’m always reluctant to fool around with new stuff outside of a container (I’m a noob, hence the “fool around” part)

Thanks!

P.S.: Just to be sure: Will cast-web allow me to make a google home mini speak whatever Webcore send him?

1 Like

wow, this is an insane setup, I can’t thank you enough @vervallsweg ! I’m loving using the chromecasts on the tvs as well as the google home minis, in addition to the samsung speakers. Those guys fretting over the dlna media renderer and android as a speech alarm device would love to get their hands on this. It is so sick to have all my google cast devices listed as speakers for any smart app!

Took me a minute to figure out the node.js, I eventually downloaded the github for mac desktop, cloned the repo that way and accessed the terminal through the top menus. Was up an running within minutes after that.

Before that I kept screwing up the terminal command line when I launched my own node from nodejs.org . I was able to get the node up and update the local IP and verify it was working, but I just couldn’t get npm install inside the repo, and so couldn’t access the v2cast. Adding sudo or just removing $ symbol from the commands helped me as well. Somebody more versed in linux commands could prob do it about 2 seconds lol.

1 Like

I would !!!

2 Likes

Yes.

I’m not using docker and nobody has made an image publicly available yet. However @janw seems to be running it inside a container. Maybe this will help you:

I’d just use a cron task to do it. Should be preinstalled on most rpi distros. Just run ‘crontab -e’ and select your favourite text editor. Then add in the last line '@reboot node /path/to/the/api/castWebApi.js {--arguments}'
If this doesn’t work immediately it might be due to it executing the command to soon after the reboot. Then just make it execute, lets say a minute after reboot.