use of com.connectsdk.service.google_cast.CastServiceChannel in project butter-android by butterproject.
the class CastWebAppSession method connect.
@Override
public void connect(final ResponseListener<Object> listener) {
if (castServiceChannel != null) {
disconnectFromWebApp();
}
castServiceChannel = new CastServiceChannel(launchSession.getAppId(), this);
try {
Cast.CastApi.setMessageReceivedCallbacks(service.getApiClient(), castServiceChannel.getNamespace(), castServiceChannel);
Util.postSuccess(listener, null);
} catch (IOException e) {
castServiceChannel = null;
Util.postError(listener, new ServiceCommandError(0, "Failed to create channel", null));
}
}
Aggregations