Closed Paul-Reed closed 4 years ago
Yes, you'd just build the message in a function node and hand it in. If you're just sending streamType BUFFERED you can exclude that, its the default. And contentType can be inferred from .mp3 on the URL too so it can be excluded if you want.
A sample flow for the most basic case would literally just be a function with this:
return {
host: '1.1.1.1',
payload: {
type: 'MEDIA',
media: {
url: 'http://youUrl'
}
}
};
Thanks, that was easier than I expected!
I've used node-RED for 4 years now, and this is the first time I've started a function node with;
return {
I usually end with;
return msg
I have it working now.
I'm using your example to cast a mp3 file;
...but I'm struggling formatting the message in node-RED. What are you using - a function node, change node etc? It would be great if you had a quick flow to demo what nodes to use to get the message in the right format.
Thanks
Paul