i8beef / node-red-contrib-castv2

MIT License
22 stars 15 forks source link

Get basic commands to work #56

Closed Voune closed 3 years ago

Voune commented 3 years ago

Hi! This is the first time I test this node and got stuck immediately. I have a chromecast which seems to respond to changes, and the node says connected. But when I use commands from the phone the debug in node red replies with msg.payload : undefined. Although I get the commands for MUTE, UNMUTE and VOLUME to be working. But the others in the list of Platform command examples just not respond. Youtube seems to work like a charm, but others streaming apps (Netflix for example) I've tested doesen't work at all with Media command examples. Only getting "Error: No active receiver application".

I understood that Media command examples must be supported from the streaming app? But the Platform command examples should work regardless of type of streaming?

My case is that I want to start a stream on the phone and then node red should be able to pause or close.

Here is my code from the function node into the castv2 node. In my tests I just switched "PAUSE" to different commands. Also tried defining app: DefaultMediaReceiver but that wouldn´t be necessary?

msg= { payload: { type: "PAUSE" } } return msg;

i8beef commented 3 years ago

First off, are you running the latest version (4.0.1)? In the newer versions, media commands are SUPPOSED to work for any cast receivers that support them regardless of direct support here.

DefaultMediaReceiver is NEVER required (Its the default), but you have to specify YouTube, etc. when executing receiver specific commands (mostly MEDIA commands right now) for a given app other than that... but regular media commands like PLAY, PAUSE, etc. should just work if supported right now. Think of it like three layers of commands: platform, media, receiver

  1. Platform just always works, its the cast device itself.
  2. Media commands work when there is an app running, and it claims to support the generic media command you are trying to run
  3. Receiver commands need to be manually implemented for the specific receiver, as these are basically special to the receiver implementation. DefaultMediaReceiver MEDIA is actually a receiver level command, but because thats the default receiver it tries to use, you don't have to specify that... but YouTube MEDIA commands DO because YouTube is not the default receiver app.

Also, check your node-red logs. A hard, HARD failure can sometimes crash the entire node instance and you'd only get a message out there. I try and guard all those locally, but bugs happen.

Voune commented 3 years ago

It seems like I didn't get the latest version when I downloaded the node. After the update it works like a charm in the streams I've tested so far. Thank you for a great node and fast support!

i8beef commented 3 years ago

Glad to hear it! Let me know if you have any other issues!