Package com.google.gdata.data.youtube

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


          }
        }

        if (videoEntry != null) {
          try {
            YtPublicationState state = videoEntry.getPublicationState();
            String stateValue;
            if (state == null) {
              // TODO: Find some way to check whether the video is embeddable
              // and/or private, and
              // populate that info. Because we're getting the video from the
              // authenticated
              // uploads feed (by default), that info isn't easily exposed on
              // the videoEntry
              // object. An alternative would be to get an instance from the
              // public video feed
              // and check that.

              List<YouTubeMediaRating> ratings = videoEntry.getMediaGroup().getYouTubeRatings();
              if (ratings.size() == 0) {
                stateValue = "OKAY";
              } else {
                StringBuffer restrictionBuffer = new StringBuffer("RESTRICTED IN: ");
                for (YouTubeMediaRating rating : ratings) {
                  restrictionBuffer.append(rating.getCountries());
                }
                stateValue = restrictionBuffer.toString();
              }
            } else {
              stateValue = state.getState().toString();
            }
            if (!stateValue.equals(videoSubmission.getYouTubeState())) {
              log.info(String.format("YouTube state differs: '%s' (local) vs. '%s' (YT).",
                  videoSubmission.getYouTubeState(), stateValue));
              videoSubmission.setYouTubeState(stateValue);
View Full Code Here


        }
      }

      if (videoEntry != null) {
        try {
          YtPublicationState state = videoEntry.getPublicationState();
          String stateValue;
          if (state == null) {
            // TODO: Find some way to check whether the video is embeddable and/or private, and
            // populate that info. Because we're getting the video from the authenticated
            // uploads feed (by default), that info isn't easily exposed on the videoEntry
            // object. An alternative would be to get an instance from the public video feed
            // and check that.

            List<YouTubeMediaRating> ratings = videoEntry.getMediaGroup().getYouTubeRatings();
            if (ratings.size() == 0) {
              stateValue = "OKAY";
            } else {
              StringBuffer restrictionBuffer = new StringBuffer("RESTRICTED IN: ");
              for (YouTubeMediaRating rating : ratings) {
                restrictionBuffer.append(rating.getCountries());
              }
              stateValue = restrictionBuffer.toString();
            }
          } else {
            stateValue = state.getState().toString();
          }
          if (!stateValue.equals(videoSubmission.getYouTubeState())) {
            LOG.info(String.format("YouTube state differs: '%s' (local) vs. '%s' (YT).",
                videoSubmission.getYouTubeState(), stateValue));
            videoSubmission.setYouTubeState(stateValue);
View Full Code Here

      }
    }

    if (entry.isDraft()) {
      System.out.println("Video is not live");
      YtPublicationState pubState = entry.getPublicationState();
      if (pubState.getState() == YtPublicationState.State.PROCESSING) {
        System.out.println("Video is still being processed.");
      } else if (pubState.getState() == YtPublicationState.State.REJECTED) {
        System.out.print("Video has been rejected because: ");
        System.out.println(pubState.getDescription());
        System.out.print("For help visit: ");
        System.out.println(pubState.getHelpUrl());
      } else if (pubState.getState() == YtPublicationState.State.FAILED) {
        System.out.print("Video failed uploading because: ");
        System.out.println(pubState.getDescription());
        System.out.print("For help visit: ");
        System.out.println(pubState.getHelpUrl());
      }
    }
  }
View Full Code Here

TOP

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

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.