use of com.connectsdk.service.airplay.PListBuilder in project butter-android by butterproject.
the class AirPlayService method playVideo.
public void playVideo(final String url, String mimeType, String title, String description, String iconSrc, boolean shouldLoop, final LaunchListener listener) {
ResponseListener<Object> responseListener = new ResponseListener<Object>() {
@Override
public void onSuccess(Object response) {
LaunchSession launchSession = new LaunchSession();
launchSession.setService(AirPlayService.this);
launchSession.setSessionType(LaunchSessionType.Media);
Util.postSuccess(listener, new MediaLaunchObject(launchSession, AirPlayService.this));
startTimer();
}
@Override
public void onError(ServiceCommandError error) {
Util.postError(listener, error);
}
};
String uri = getRequestURL("play");
String payload = null;
PListBuilder builder = new PListBuilder();
builder.putString("Content-Location", url);
builder.putReal("Start-Position", 0);
payload = builder.toString();
ServiceCommand<ResponseListener<Object>> request = new ServiceCommand<ResponseListener<Object>>(this, uri, payload, responseListener);
request.send();
}
Aggregations