Beispiel #1
0
 public static String getPlayer(VideoEntry v) {
   if (v.getMediaGroup().getYouTubeContents().isEmpty()) {
     return "http://www.mangawire.net/forums";
   } else {
     String url = v.getMediaGroup().getYouTubeContents().get(0).getUrl();
     if (url.startsWith("http://")) {
       return url;
     } else {
       return "http://www.mangawire.net/forums";
     }
   }
 }
Beispiel #2
0
  public static String XmlEntries(String prefix, VideoEntry videoEntry) {
    String entryText = "<prefix>" + prefix + "</prefix>";

    if (videoEntry.getTitle() != null) {
      entryText += "<title>";
      entryText += "Title: " + videoEntry.getTitle().getPlainText();
      entryText += "</title>";
    }
    if (videoEntry.getSummary() != null) {
      entryText += "<summary>";
      entryText += "Summary: " + videoEntry.getSummary().getPlainText();
      entryText += "</summary>";
    }
    YouTubeMediaGroup mediaGroup = videoEntry.getMediaGroup();
    if (mediaGroup != null) {
      MediaPlayer mediaPlayer = mediaGroup.getPlayer();
      entryText += "<url>";
      entryText += mediaPlayer.getUrl();
      entryText += "</url>";
      MediaKeywords keywords = mediaGroup.getKeywords();
      entryText += "<keywords>";
      for (String keyword : keywords.getKeywords()) {
        entryText += keyword + ",";
      }
      entryText += "</keywords>";
      entryText += "<thumbnails>";
      for (MediaThumbnail mediaThumbnail : mediaGroup.getThumbnails()) {
        entryText += "<url>" + mediaThumbnail.getUrl() + "</url>";
        entryText += "<time_index>" + mediaThumbnail.getTime() + "<time_index>";
      }
      entryText += "<media>";
      for (YouTubeMediaContent mediaContent : mediaGroup.getYouTubeContents()) {
        entryText += "<media_location>" + mediaContent.getUrl() + "</media_location>";
        entryText += "<media_type>" + mediaContent.getType() + "</media_type>";
        entryText += "<duration>" + mediaContent.getDuration() + "</duration>";
      }
    }
    return entryText;
  }
Beispiel #3
0
 public static String getThumbNail(VideoEntry v) {
   return v.getMediaGroup().getThumbnails().get(0).getUrl();
 }
Beispiel #4
0
 public static String getVideoTitle(VideoEntry v) {
   return v.getMediaGroup().getTitle().getPlainTextContent();
 }