Youtube Data API Like Insertion

时间:2015-08-15 17:52:28

标签: android youtube youtube-data-api

有人可以帮我处理以下代码吗?我无法将相似内容插入视频中。

    List<String> scopes = Lists.newArrayList("https://www.googleapis.com/auth/youtubepartner",
                   "https://www.googleapis.com/auth/youtube",
                    "https://www.googleapis.com/auth/youtube.force-ssl");

            GoogleAccountCredential credential;


            credential =  GoogleAccountCredential.usingOAuth2(getApplicationContext(), scopes);
            HttpTransport transport = AndroidHttp.newCompatibleTransport();
            JsonFactory jsonFactory = new GsonFactory();
            SharedPreferences sp = PreferenceManager
                    .getDefaultSharedPreferences(DSCActivity.this);
            credential.setSelectedAccountName(sp.getString(Constants.ACCOUNT_KEY, null));
            credential.setBackOff(new ExponentialBackOff());

            String appName = "xyz App"; // This is registered in the google developer console
             YouTube youtube =
                    new YouTube.Builder(transport, jsonFactory, credential).setApplicationName(
                            appName).build();


          YouTube.Videos.Rate obj = youtube.videos().rate(id,requiredAction);

 // Here id is video ID and requiredAction is like

0 个答案:

没有答案