onStateUpdate method
This method gets called whenever the OpenTok session state changes.
The new state value is also passed as a parameter.
Implementation
void onStateUpdate(open_tok.ConnectionStateCallback connection) async {
value = value.copyWith(
state: connection.state, errorDescription: connection.errorDescription);
}