コード例 #1
0
 public PageVideosInfo getVideoOfChannel(String id_channel) {
   DailymotionDTO dailymotionDTO =
       RestfulService.getInstance(Configs.HOST_NAME.DAILYMOON)
           .getVideosOfChannel(
               id_channel,
               "title,channel,country,description,duration,id,poster,thumbnail_720_url,url",
               "visited",
               1l,
               50l);
   List<VideoItem> videoItems = new ArrayList<>();
   if (dailymotionDTO != null) {
     if (dailymotionDTO.getDailymotionDetailDTOs() != null
         && dailymotionDTO.getDailymotionDetailDTOs().size() > 0) {
       List<DailymotionDetailDTO> dailymotionDetailDTOList =
           dailymotionDTO.getDailymotionDetailDTOs();
       for (DailymotionDetailDTO dailymotionDetailDTO : dailymotionDetailDTOList) {
         VideoItem videoItem = new VideoItem();
         videoItem.setId(dailymotionDetailDTO.getId());
         videoItem.setTitle(dailymotionDetailDTO.getTitle());
         videoItem.setUrl(dailymotionDetailDTO.getUrl());
         videoItem.setUrlThumbnail(dailymotionDetailDTO.getThumbnail_720_url());
         videoItem.setDescription(dailymotionDetailDTO.getDescription());
         videoItem.setHost_name(Configs.HOST_NAME.DAILYMOON);
         videoItems.add(videoItem);
       }
     }
   }
   PageVideosInfo pageVideosInfo = new PageVideosInfo(videoItems);
   return pageVideosInfo;
 }
コード例 #2
0
 public PageVideosInfo search(DailymotionInfo dailymotionInfo) {
   DailymotionDTO dailymotionDTO =
       RestfulService.getInstance(Configs.HOST_NAME.DAILYMOON)
           .searchDailymotion(
               dailymotionInfo.getKeyWord(),
               dailymotionInfo.getFields(),
               dailymotionInfo.getFlags(),
               dailymotionInfo.getSort(),
               dailymotionInfo.getPage(),
               dailymotionInfo.getLimit());
   List<VideoItem> videoItems = new ArrayList<>();
   if (dailymotionDTO != null) {
     if (dailymotionDTO.getDailymotionDetailDTOs() != null
         && dailymotionDTO.getDailymotionDetailDTOs().size() > 0) {
       List<DailymotionDetailDTO> dailymotionDetailDTOList =
           dailymotionDTO.getDailymotionDetailDTOs();
       for (DailymotionDetailDTO dailymotionDetailDTO : dailymotionDetailDTOList) {
         VideoItem videoItem = new VideoItem();
         videoItem.setId(dailymotionDetailDTO.getId());
         videoItem.setTitle(dailymotionDetailDTO.getTitle());
         videoItem.setUrl(dailymotionDetailDTO.getUrl());
         videoItem.setUrlThumbnail(dailymotionDetailDTO.getThumbnail_720_url());
         videoItem.setDescription(dailymotionDetailDTO.getDescription());
         videoItem.setHost_name(Configs.HOST_NAME.DAILYMOON);
         videoItems.add(videoItem);
       }
     }
   }
   PageVideosInfo pageVideosInfo = new PageVideosInfo(videoItems);
   return pageVideosInfo;
 }
コード例 #3
0
 public PageVideosInfo getMostPopular(Long page, Long limit) {
   DailymotionDTO dailymotionDTO =
       RestfulService.getInstance(Configs.HOST_NAME.DAILYMOON)
           .getMostPopularVideoDailymotion(
               "title,channel,country,description,duration,id,poster,thumbnail_720_url,url,",
               "no_live,no_premium",
               "visited",
               page,
               limit);
   List<VideoItem> videoItems = new ArrayList<>();
   if (dailymotionDTO != null) {
     if (dailymotionDTO.getDailymotionDetailDTOs() != null
         && dailymotionDTO.getDailymotionDetailDTOs().size() > 0) {
       List<DailymotionDetailDTO> dailymotionDetailDTOList =
           dailymotionDTO.getDailymotionDetailDTOs();
       for (DailymotionDetailDTO dailymotionDetailDTO : dailymotionDetailDTOList) {
         VideoItem videoItem = new VideoItem();
         videoItem.setId(dailymotionDetailDTO.getId());
         videoItem.setTitle(dailymotionDetailDTO.getTitle());
         videoItem.setUrl(dailymotionDetailDTO.getUrl());
         videoItem.setUrlThumbnail(dailymotionDetailDTO.getThumbnail_720_url());
         videoItem.setDescription(dailymotionDetailDTO.getDescription());
         videoItem.setHost_name(Configs.HOST_NAME.DAILYMOON);
         videoItems.add(videoItem);
       }
     }
   }
   PageVideosInfo pageVideosInfo = new PageVideosInfo(videoItems);
   return pageVideosInfo;
 }