use of com.zype.android.webapi.model.entitlements.VideoEntitlements in project zype-android by zype.
the class MyLibraryFragment method handleVideoEntitlements.
// ///////////
// Subscriptions
//
@Subscribe
public void handleVideoEntitlements(VideoEntitlementsEvent event) {
VideoEntitlements data = event.getEventData().getModelData();
Logger.d("handleVideoEntitlements(): size=" + data.videoEntitlements.size());
for (VideoEntitlementData item : data.videoEntitlements) {
videoEntitlements.put(item.videoId, item);
}
if (Pagination.hasNextPage(data.pagination) && !data.videoEntitlements.isEmpty()) {
requestVideoEntitlements(Pagination.getNextPage(data.pagination));
} else {
// Clear entitlement flag in all existing videos
VideoHelper.setEntitlement(getActivity().getContentResolver(), null, false, "");
// Load videos with entitlements
for (String videoId : videoEntitlements.keySet()) {
VideoParamsBuilder builder = new VideoParamsBuilder().addVideoId(videoId);
getApi().executeRequest(WebApiManager.Request.VIDEO_LATEST_GET, builder.build());
}
}
}
Aggregations