handle invalid option when handle setOptions action

This commit is contained in:
nklhrstv 2020-05-18 14:18:49 +03:00
parent 817dcbd3cc
commit 8bd26cb601

View file

@ -187,7 +187,15 @@ function ChromecastTransport() {
if (action) {
switch (action.type) {
case 'setOptions': {
cast.framework.CastContext.getInstance().setOptions(action.options);
try {
cast.framework.CastContext.getInstance().setOptions(action.options);
} catch (error) {
events.emit('error', {
...CAST_ERROR.INVALID_OPTIONS,
error
});
}
return;
}
case 'requestSession': {