use of com.connectsdk.core.ProgramInfo in project butter-android by butterproject.
the class WebOSTVService method getChannelCurrentProgramInfo.
private ServiceCommand<ResponseListener<Object>> getChannelCurrentProgramInfo(boolean isSubscription, final ProgramInfoListener listener) {
String uri = "ssap://tv/getChannelCurrentProgramInfo";
ServiceCommand<ResponseListener<Object>> request;
ResponseListener<Object> responseListener = new ResponseListener<Object>() {
@Override
public void onSuccess(Object response) {
JSONObject jsonObj = (JSONObject) response;
ProgramInfo programInfo = parseRawProgramInfo(jsonObj);
Util.postSuccess(listener, programInfo);
}
@Override
public void onError(ServiceCommandError error) {
Util.postError(listener, error);
}
};
if (isSubscription)
request = new URLServiceSubscription<ResponseListener<Object>>(this, uri, null, true, responseListener);
else
request = new ServiceCommand<ResponseListener<Object>>(this, uri, null, true, responseListener);
request.send();
return request;
}
use of com.connectsdk.core.ProgramInfo in project butter-android by butterproject.
the class WebOSTVService method parseRawProgramInfo.
private ProgramInfo parseRawProgramInfo(JSONObject programRawData) {
String programId;
String programName;
ProgramInfo programInfo = new ProgramInfo();
programInfo.setRawData(programRawData);
programId = programRawData.optString("programId");
programName = programRawData.optString("programName");
ChannelInfo channelInfo = parseRawChannelData(programRawData);
programInfo.setId(programId);
programInfo.setName(programName);
programInfo.setChannelInfo(channelInfo);
return programInfo;
}
Aggregations