use of org.fourthline.cling.support.avtransport.callback.GetMediaInfo in project BeyondUPnP by kevinshine.
the class PlaybackCommand method getMediaInfo.
public static void getMediaInfo(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 GetMediaInfo(avtService) {
@Override
public void received(ActionInvocation invocation, MediaInfo mediaInfo) {
Message msg = Message.obtain(handler, NowplayingFragment.GET_MEDIA_INFO_ACTION);
msg.obj = mediaInfo;
msg.sendToTarget();
}
@Override
public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMsg) {
Log.e(TAG, "GetMediaInfo failed");
}
});
}
}
Aggregations