Package com.google.gdata.data.youtube

Examples of com.google.gdata.data.youtube.VideoEntry


    Tube tub = new Tube();
    try {
      System.out.println("Update from youtube : " + id);
      String videoEntryUrl = "http://gdata.youtube.com/feeds/api/videos/"
          + id;
      VideoEntry videoEntry = service.getEntry(new URL(videoEntryUrl),
          VideoEntry.class);
      if (fullContent) {
        tub.transformVideoEntry(videoEntry);
      } else {
        tub.transformHalfVideoEntry(videoEntry);
View Full Code Here


      VideoFeed batchFeed = new VideoFeed();
      BatchUtils.setBatchOperationType(batchFeed,
          BatchOperationType.QUERY);

      for (String videoId : tubeIds) {
        VideoEntry videoEntry = new VideoEntry(
            String.format(
                "http://gdata.youtube.com/feeds/api/videos/%s",
                videoId));
        batchFeed.getEntries().add(videoEntry);
      }
View Full Code Here

        totalResult = 1;
      } else {
        System.out.println("Searching video from Youtube...");
        String videoEntryUrl = "http://gdata.youtube.com/feeds/api/videos/"
            + id;
        VideoEntry videoEntry = service.getEntry(
            new URL(videoEntryUrl), VideoEntry.class);
        tub = videoEntryToTube(videoEntry);
        initCache();
        currentTube = tub;
        listResult.add(tub);
View Full Code Here

        System.out.println("Getting video from cache...");
      } else {
        System.out.println("Searching video from Youtube...");
        String videoEntryUrl = "http://gdata.youtube.com/feeds/api/videos/"
            + id;
        VideoEntry videoEntry = service.getEntry(
            new URL(videoEntryUrl), VideoEntry.class);
        tub = videoEntryToTube(videoEntry);
        System.out.println("Putting to cache success !");
        tooManyRecentCallError = false;
      }
View Full Code Here

    System.out.println("Okay, adding this video: " + videoID);

    URL entryUrl = new URL("http://gdata.youtube.com/feeds/api/videos/"
        + videoID);

    VideoEntry videoEntry = null;
    try {
      videoEntry = service.getEntry(entryUrl, VideoEntry.class);
    } catch (ServiceException se) {
      // an invalid video ID was used.
    }
View Full Code Here

    String fields = "@gd:etag,media:group/media:keywords";
    Query query = new Query(entryUrl);
    query.setFields(fields);

    // Get representation for the interested fields
    VideoEntry videoEntry = null;
    try {
      videoEntry = service.getEntry(query.getUrl(), VideoEntry.class);
    } catch (ServiceException se) {
      // an invalid video ID was used.
    }
    if (videoEntry == null) {
      output.println("Sorry, the video ID you entered was not valid.\n");
      return;
    }
    output.println("Current Keywords: "
        + videoEntry.getMediaGroup().getKeywords().getKeywords());

    // add a new keyword
    output.println("Specify a keyword to add: ");
    String keyword = readLine();
    videoEntry.getMediaGroup().getKeywords().addKeyword(keyword);
    VideoEntry updatedEntry = service.patch(entryUrl, fields, videoEntry);
    output.println("Keywords after update: "
        + updatedEntry.getMediaGroup().getKeywords().getKeywords());
  }
View Full Code Here

    System.out.println("Okay, adding a comment to: " + videoID);

    URL entryUrl = new URL("http://gdata.youtube.com/feeds/api/videos/"
        + videoID);

    VideoEntry videoEntry = null;
    try {
      videoEntry = service.getEntry(entryUrl, VideoEntry.class);
    } catch (ServiceException se) {
      // an invalid video ID was used.
    }

    if (videoEntry == null) {
      System.out.println("Sorry, the video ID you entered was not valid.\n");
      return;
    }

    System.out.println("Enter your comment: ");

    String input = readLine();

    String commentUrl = videoEntry.getComments().getFeedLink().getHref();

    CommentEntry newComment = new CommentEntry();
    newComment.setContent(new PlainTextConstruct(input));

    try {
View Full Code Here

    String mimeType = readLine();

    System.out.println("What should I call this video?");
    String videoTitle = readLine();

    VideoEntry newEntry = new VideoEntry();

    YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();

    mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, "Tech"));
    mg.setTitle(new MediaTitle());
    mg.getTitle().setPlainTextContent(videoTitle);
    mg.setKeywords(new MediaKeywords());
    mg.getKeywords().addKeyword("gdata-test");
    mg.setDescription(new MediaDescription());
    mg.getDescription().setPlainTextContent(videoTitle);
    MediaFileSource ms = new MediaFileSource(videoFile, mimeType);
    newEntry.setMediaSource(ms);

    try {
      service.insert(new URL(VIDEO_UPLOAD_FEED), newEntry);
    } catch (ServiceException se) {
      System.out.println("Sorry, your upload was invalid:");
View Full Code Here

    System.out.println("Okay, favoriting: " + videoID);

    URL entryUrl = new URL("http://gdata.youtube.com/feeds/api/videos/"
        + videoID);

    VideoEntry videoEntry = null;
    try {
      videoEntry = service.getEntry(entryUrl, VideoEntry.class);
    } catch (ServiceException se) {
      // an invalid video ID was used.
    }
View Full Code Here

    MediaFileSource ms = new MediaFileSource(videoFile, readLine());

    output.println("What should I call this video?");
    String videoTitle = readLine();

    VideoEntry newEntry = new VideoEntry();
    YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();
    mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, "Tech"));
    mg.setTitle(new MediaTitle());
    mg.getTitle().setPlainTextContent(videoTitle);
    mg.setKeywords(new MediaKeywords());
    mg.getKeywords().addKeyword("gdata-test");
View Full Code Here

TOP

Related Classes of com.google.gdata.data.youtube.VideoEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.