How to cast videos

I'm not certain what home-assistant has to do with this?

I cant imagine what setting up a URL to host an MP3 has to do with anything outside of node-red.

The first test in my mind is - can you access the MP3 in your browser? If you cant, then there is no way the cast device is gonna.

On the same machine where node-red is running, what happens if you point your browser at http://localhost:1880/endpoint/alavp ?
do you get anything?

PS - it works for me...
image

[{"id":"d5a6dd33.a0e28","type":"http in","z":"c70ba4a4.e7fb58","name":"","url":"/endpoint/alavp","method":"get","upload":false,"swaggerDoc":"","x":110,"y":120,"wires":[["d59c8c4.b480d7","e7ed07e7.97da58"]]},{"id":"d59c8c4.b480d7","type":"file in","z":"c70ba4a4.e7fb58","name":"","filename":"alavp.mp3","format":"","chunk":false,"sendError":false,"encoding":"none","x":180,"y":160,"wires":[["87b9c5b8.526558","49056e53.5a32b"]]},{"id":"87b9c5b8.526558","type":"http response","z":"c70ba4a4.e7fb58","name":"","statusCode":"","headers":{"contentType":"audio/mp3"},"x":360,"y":160,"wires":[]},{"id":"e7ed07e7.97da58","type":"debug","z":"c70ba4a4.e7fb58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":320,"y":80,"wires":[]},{"id":"49056e53.5a32b","type":"debug","z":"c70ba4a4.e7fb58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":340,"y":120,"wires":[]},{"id":"b72151a6.617e3","type":"cast-to-client","z":"c70ba4a4.e7fb58","name":"","url":null,"contentType":"","message":null,"language":"en","ip":"","port":"","volume":null,"x":360,"y":220,"wires":[[]]},{"id":"2dbcc2cc.94f80e","type":"inject","z":"c70ba4a4.e7fb58","name":"","topic":"","payload":"{\"ip\":\"192.168.0.55\",\"url\":\"http://192.168.0.81:1880/endpoint/alavp\",\"contentType\":\"audio/mp3\",\"volume\":50}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":80,"y":220,"wires":[["b72151a6.617e3"]]}]

NOTES:

  • put an MP3 called alavp.mp3 in the .node-red folder (or adjust the path of the file in node)
  • change the 2 IP addresses in the inject node
    • change "ip" to your cast device IP
    • change "url" to your node-red PC IP
1 Like