iOS YouTube "No Filters Selected"

标签 ios objective-c youtube

我正在尝试使用 YouTube iOS SDK 发出对 playListItems 的请求。

我返回一个错误...

Error Domain=com.google.GTLJSONRPCErrorDomain
Code=-32602 "The operation couldn’t be completed. (No filter selected.)" 
UserInfo=0x1568f1e0
{
    error=No filter selected.,
    GTLStructuredError=GTLErrorObject 0x1567fdf0: {message:"No filter selected." code:-32602 data:[1]},
    NSLocalizedFailureReason=(No filter selected.)
}

我正在使用的查询是这样的...

GTLServiceYouTube *service = [[GTLServiceYouTube alloc] init];

service.APIKey = @"my key";

// I suspect the problem is here...
GTLQueryYouTube *query = [GTLQueryYouTube queryForPlaylistItemsListWithPart:@"contentDetails"];
query.q = @"playlistId=<The playlist ID>";

GTLServiceTicket *ticket = [service executeQuery:query
                               completionHandler:^(GTLServiceTicket *ticket, id object, NSError *error) {
                                   if (!error) {
                                       GTLYouTubePlaylistItemListResponse *playlistItems = object;

                                       for (GTLYouTubePlaylistItem *playlistItem in playlistItems) {
                                           GTLYouTubePlaylistItemContentDetails *details = playlistItem.contentDetails;

                                           NSLog(@"PlaylistItem video ID = %@", details.videoId);
                                       }
                                   } else {
                                       NSLog(@"%@", error);
                                   }
                               }];

问题是整个 API 的文档都是无用的,所以没有使用它的例子。我必须从 Google 购物 API 和其他东西的示例中将其组合在一起。

大部分猜测工作来自here .

我应该在 query.q 值中放入什么?或者我是否还缺少其他东西?

最佳答案

好的,我终于找到了一个链接,其中包含一些链接。

要使用的代码是...

query.playlistId = @"the playlist ID";

然后一切正常:D

关于iOS YouTube "No Filters Selected",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18092161/

相关文章:

iphone - Core Plot 中的 Scatter Plot 到底是什么?

ios - 尝试定义字符数组时,我不断收到三个错误

ios - 如何到达发件人的父 View ?

ios - 在 iOS 中绘图时裁剪部分 PDF 页面

html - 我的 YouTube 视频不会显示在 iframe 中

ios - Swift - UIViewController 内的 UITableView,不调用 UITableView 函数

ios - 使用 Facebook 的 FirebaseSimpleLogin 后,Firebase observeEventType 没有触发?

objective-c - 为什么我的导航栏 Controller 不处理我的导航栏 View 上的 touchesEnded 事件?

url - 从YouTube获取RTSP URL

javascript - GDPR : youtube-nocookie embedded URL's, 需要访问者的许可吗?