use of com.zype.android.webapi.builder.VideoParamsBuilder in project zype-android by zype.
the class TestVideo method testHighLightVideo.
@SmallTest
public void testHighLightVideo() throws Exception {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
VideoParamsBuilder builder = new VideoParamsBuilder().addPage(1).addCategoryHighlight(true);
mApi.executeRequest(WebApiManager.Request.VIDEO_LATEST_GET, builder.build());
}
});
assertTrue(mLock.await(TEST_FAIL_TIME, TimeUnit.MILLISECONDS));
}
use of com.zype.android.webapi.builder.VideoParamsBuilder in project zype-android by zype.
the class TestVideo method testGetWeekVideo.
@SmallTest
public void testGetWeekVideo() throws Exception {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
VideoParamsBuilder builder = new VideoParamsBuilder().addDateLimit("2015-06-28", "2015-07-04").addPage(1);
mApi.executeRequest(WebApiManager.Request.VIDEO_LATEST_GET, builder.build());
}
});
assertTrue(mLock.await(TEST_FAIL_TIME, TimeUnit.MILLISECONDS));
}
use of com.zype.android.webapi.builder.VideoParamsBuilder in project zype-android by zype.
the class VideosActivity method loadVideosFromPlaylist.
// //////////
// Data
//
private void loadVideosFromPlaylist(int page) {
Logger.d("load Videos from playlist");
VideoParamsBuilder builder = new VideoParamsBuilder();
builder.addPlaylistId(playlistId);
builder.addPage(page);
builder.addPerPage(ParamsBuilder.PER_PAGE_DEFAULT);
getApi().executeRequest(WebApiManager.Request.VIDEO_FROM_PLAYLIST, builder.build());
}
use of com.zype.android.webapi.builder.VideoParamsBuilder 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());
}
}
}
use of com.zype.android.webapi.builder.VideoParamsBuilder in project zype-android by zype.
the class FavoritesFragment method handleConsumerFavoriteVideo.
// ///////////
// Subscriptions
//
@Subscribe
public void handleConsumerFavoriteVideo(ConsumerFavoriteVideoEvent event) {
Logger.d("handleConsumerFavoriteVideo");
ConsumerFavoriteVideo favorite = event.getEventData().getModelData();
if (Pagination.hasNextPage(favorite.getPagination()) && !favorite.getResponse().isEmpty()) {
requestConsumerFavoriteVideo(Pagination.getNextPage(favorite.getPagination()));
}
DataHelper.insertFavorites(getActivity().getContentResolver(), favorite.getResponse());
// Retrieve videos
for (ConsumerFavoriteVideoData item : favorite.getResponse()) {
VideoParamsBuilder builder = new VideoParamsBuilder().addVideoId(item.getVideoId());
getApi().executeRequest(WebApiManager.Request.VIDEO_LATEST_GET, builder.build());
}
}
Aggregations