use of org.fourthline.cling.support.avtransport.callback.GetPositionInfo in project BeyondUPnP by kevinshine.
the class PlaybackCommand method getPositionInfo.
public static void getPositionInfo(final Handler handler) {
Device device = SystemManager.getInstance().getSelectedDevice();
//Check selected device
if (device == null)
return;
Service avtService = device.findService(SystemManager.AV_TRANSPORT_SERVICE);
if (avtService != null) {
ControlPoint cp = SystemManager.getInstance().getControlPoint();
cp.execute(new GetPositionInfo(avtService) {
@Override
public void received(ActionInvocation invocation, PositionInfo positionInfo) {
Message msg = Message.obtain(handler, NowplayingFragment.GET_POSITION_INFO_ACTION);
msg.obj = positionInfo;
msg.sendToTarget();
}
@Override
public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMsg) {
Log.e(TAG, "GetPositionInfo failed");
}
});
}
}
Aggregations