Ani*_*tel 3 youtube android youtube-data-api
我从Youtube搜索列表实现youtube搜索列表
但是出现了这个错误
访问未配置.请使用Google Developers Console激活项目的API
码:-
youtube = new YouTube.Builder(transport,jsonFactory, new HttpRequestInitializer()
{
@Override
public void initialize(HttpRequest request) throws IOException {
}
}).setApplicationName("youtube-cmdline-search-sample").build();
String queryTerm = getInputQuery();
// Define the API request for retrieving search results.
YouTube.Search.List search = youtube.search().list("id,snippet");
// Set your developer key from the Google Developers Console for
String apiKey = ""; //i have server key and browser key
search.setKey(apiKey);
search.setQ(queryTerm);
search.setType("video");
search.setFields("items(id/kind,id/videoId,snippet/title,snippet/thumbnails/default/url)");
search.setMaxResults(NUMBER_OF_VIDEOS_RETURNED);
Run Code Online (Sandbox Code Playgroud)

| 归档时间: |
|
| 查看次数: |
13932 次 |
| 最近记录: |