use of android.support.v7.media.RemotePlaybackClient in project cw-omnibus by commonsguy.
the class PlaybackFragment method connect.
private void connect(MediaRouter.RouteInfo route) {
client = new RemotePlaybackClient(getActivity().getApplication(), route);
if (client.isRemotePlaybackSupported()) {
logToTranscript(getActivity().getString(R.string.connected));
if (client.isSessionManagementSupported()) {
client.startSession(null, new SessionActionCallback() {
@Override
public void onResult(Bundle data, String sessionId, MediaSessionStatus sessionStatus) {
logToTranscript(getActivity().getString(R.string.session_started));
getActivity().supportInvalidateOptionsMenu();
}
@Override
public void onError(String error, int code, Bundle data) {
logToTranscript(getActivity().getString(R.string.session_failed));
}
});
} else {
getActivity().supportInvalidateOptionsMenu();
}
} else {
logToTranscript(getActivity().getString(R.string.remote_playback_not_supported));
client = null;
}
}
use of android.support.v7.media.RemotePlaybackClient in project cw-omnibus by commonsguy.
the class PlaybackFragment method connect.
private void connect(MediaRouter.RouteInfo route) {
client = new RemotePlaybackClient(getActivity().getApplication(), route);
if (client.isRemotePlaybackSupported()) {
logToTranscript(getActivity().getString(R.string.connected));
if (client.isSessionManagementSupported()) {
client.startSession(null, new SessionActionCallback() {
@Override
public void onResult(Bundle data, String sessionId, MediaSessionStatus sessionStatus) {
logToTranscript(getActivity().getString(R.string.session_started));
updateMenu();
}
@Override
public void onError(String error, int code, Bundle data) {
logToTranscript(getActivity().getString(R.string.session_failed));
}
});
} else {
getActivity().supportInvalidateOptionsMenu();
}
} else {
logToTranscript(getActivity().getString(R.string.remote_playback_not_supported));
client = null;
}
}
use of android.support.v7.media.RemotePlaybackClient in project cw-omnibus by commonsguy.
the class MainActivity method connect.
private void connect(MediaRouter.RouteInfo route) {
client = new RemotePlaybackClient(getApplicationContext(), route);
if (client.isRemotePlaybackSupported()) {
String url = preso.getSlideURL(pager.getCurrentItem());
client.play(Uri.parse(url), "image/png", null, 0, null, playCB);
} else {
client = null;
}
}
Aggregations