【问题标题】:YouTube PlayListitemInsert code not working APIYouTube PlayListitemInsert 代码不起作用 API
【发布时间】:2017-03-06 18:54:48
【问题描述】:

我的代码可以执行正常工作的 youtube 上传,完成后,它会尝试将视频移动到特定的播放列表。

为了进行测试,我已将播放列表(正确且经过重新验证)和 videoid(确实存在于我的频道中)硬编码到代码中。

我无法将视频添加到我指定的播放列表并从 NSlog 查询 1 中获取以下输出,但没有错误。

查询 1:GTLQueryYouTube 0x1700b0860:{method:youtube.playlistItems.insert params:(part) bodyObject:GTLYouTubePlaylistItem}

任何想法我缺少什么?

// Enter PlaylistItem Code
GTLYouTubePlaylistItem *playlistitem = [[GTLYouTubePlaylistItem alloc] init];
GTLYouTubePlaylistItemSnippet *playlistitemSnippet = [[GTLYouTubePlaylistItemSnippet alloc] init];

playlistitemSnippet.playlistId = @"PL4YcQc6s41BjKOoAPAQ_B-KNC2JBB3gl2";
playlistitemSnippet.resourceId.kind = @"youtube#video";
playlistitemSnippet.resourceId.videoId = @"4frmxoGMOcQ";

GTLQueryYouTube *query1 = [GTLQueryYouTube queryForPlaylistItemsInsertWithObject:playlistitem part:@"snippet"];


UIAlertView *waitIndicator1 = [Utils showWaitIndicator:@"Moving Video to Playlist"];

NSLog(@"Query1: %@", query1);

[service executeQuery:query1
           completionHandler:^(GTLServiceTicket *ticket,
                               GTLYouTubePlaylistItem *resource, NSError *error) {
               [waitIndicator1 dismissWithClickedButtonIndex:0 animated:YES];

【问题讨论】:

    标签: api youtube youtube-api youtube-data-api


    【解决方案1】:

    最终放弃了这个并使用了 youtube 中的播放列表自动添加功能。更容易。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-06
      • 2018-08-18
      • 1970-01-01
      • 1970-01-01
      • 2018-12-27
      • 2013-08-16
      • 2015-01-17
      • 2013-02-09
      相关资源
      最近更新 更多