I'm developing a CAF web receiver, but I can't hear the Google Assistant voice on the Nest HUB when an error is raised in the setMessageInterceptor for type "LOAD", instead it works for type "SEEK".
This is the code for SEEK:
playerManager.setMessageInterceptor(
cast.framework.messages.MessageType.SEEK, seekData => {
let e = new cast.framework.messages.ErrorData(cast.framework.messages.ErrorType
.LOAD_CANCELLED);
e.reason = cast.framework.messages.ErrorReason.PARENTAL_CONTROL_RESTRICTED;
return e;
});
and this for LOAD:
playerManager.setMessageInterceptor(
cast.framework.messages.MessageType.LOAD, loadRequestData => {
let e = new cast.framework.messages.ErrorData(cast.framework.messages.ErrorType
.LOAD_CANCELLED);
e.reason = cast.framework.messages.ErrorReason.PARENTAL_CONTROL_RESTRICTED;
return e;
});
Obviously, the real "LOAD" case is more complex but also if I use the Google code here (https://developers.google.com/cast/docs/web_receiver/core_features#error_handling) I can't hear any voice. I'm using the CaC Tool https://casttool.appspot.com/cactool/index.html for the entity flow.
playerManager.setMessageInterceptor(
cast.framework.messages.MessageType.LOAD, loadRequestData => {
const error = new cast.framework.messages.ErrorData(cast.framework.messages.ErrorType.LOAD_CANCELLED);
loadRequestData.media = null; // trying to force error
if (!loadRequestData || !loadRequestData.media) {
error.reason = cast.framework.messages.ErrorReason.INVALID_PARAM;
return error;
}
...
return loadRequestData;
});