I need to draw in UI a proper volume level on client (sender) side when working with Chromecast Audio. I see there are two ways of receiving (and might setting as well) volume from Chromecast - from Receiver
and Media
namespaces. In my understanding Receiver
namespace stores general device's volume while Media
namespace stores volume of currently played track.
- It seems that I can't receive media volume by using
GET_STATUS
request forMedia
namespace before I load any tracks withLOAD
request. Then how do I correctly display volume that will be used before loading media? Changing in UIRECEIVER
volume toMEDIA
volume after media is loaded doesn't look like a good solution and will be a surprise for users. I fail to control volume using
SET_VOLUME
request forReceiver
namespace - I've got no reply from ChromecastJson::Value msg, response; msg["type"] = "SET_VOLUME"; msg["requestId"] = ++request_id; msg["volume"]["level"] = value; // float response = send("urn:x-cast:com.google.cast.receiver", msg);
If the following lines are used instead of the last one, media volume is controlled OK:
msg["mediaSessionId"] = m_media_session_id; response = send("urn:x-cast:com.google.cast.media", msg);
What am I doing wrong here?