use of com.google.android.gms.cast.Cast.MessageReceivedCallback in project zype-android by zype.
the class VideoCastManager method attachDataChannel.
/*
* If a data namespace was provided when initializing this class, we set things up for a data
* channel
*
* @throws NoConnectionException
* @throws TransientNetworkDisconnectionException
*/
private void attachDataChannel() throws TransientNetworkDisconnectionException, NoConnectionException {
if (TextUtils.isEmpty(mDataNamespace)) {
return;
}
if (mDataChannel != null) {
return;
}
checkConnectivity();
mDataChannel = new MessageReceivedCallback() {
@Override
public void onMessageReceived(CastDevice castDevice, String namespace, String message) {
for (VideoCastConsumer consumer : mVideoConsumers) {
consumer.onDataMessageReceived(message);
}
}
};
try {
Cast.CastApi.setMessageReceivedCallbacks(mApiClient, mDataNamespace, mDataChannel);
} catch (IOException | IllegalStateException e) {
LOGE(TAG, "attachDataChannel()", e);
}
}
use of com.google.android.gms.cast.Cast.MessageReceivedCallback in project Shuttle by timusus.
the class VideoCastManager method attachDataChannel.
/*
* If a data namespace was provided when initializing this class, we set things up for a data
* channel
*
* @throws NoConnectionException
* @throws TransientNetworkDisconnectionException
*/
private void attachDataChannel() throws TransientNetworkDisconnectionException, NoConnectionException {
if (TextUtils.isEmpty(mDataNamespace)) {
return;
}
if (mDataChannel != null) {
return;
}
checkConnectivity();
mDataChannel = new MessageReceivedCallback() {
@Override
public void onMessageReceived(CastDevice castDevice, String namespace, String message) {
for (VideoCastConsumer consumer : mVideoConsumers) {
consumer.onDataMessageReceived(message);
}
}
};
try {
Cast.CastApi.setMessageReceivedCallbacks(mApiClient, mDataNamespace, mDataChannel);
} catch (IOException | IllegalStateException e) {
LOGE(TAG, "attachDataChannel()", e);
}
}
Aggregations