StateChangeHandler
Wed Jul 14 2021 23:13:54 GMT+0000 (Coordinated Universal Time)
Saved by
@surrealemily
function stateChangeHandler(connectionState, message) {
switch (connectionState) {
case HighFidelityAudio.HiFiConnectionStates.Connected:
console.log(`Connected successfully!`);
break;
case HighFidelityAudio.HiFiConnectionStates.Failed:
console.error(`Connection failed!`);
console.error(message);
break;
default:
console.log(`State changed to ${connectionState}`);
break;
}
}
let hifiCommunicator = new HighFidelityAudio.HiFiCommunicator({
onConnectionStateChanged: stateChangeHandler
});
content_copyCOPY
Comments