“用户被禁止直播。” (域= com.google.GTLRErrorObjectDomain代码= 403)

时间:2019-04-05 19:46:11

标签: ios objective-c youtube-api youtube-livestreaming-api

当我尝试执行插入广播的请求时,收到错误消息:

  

Error Domain = com.google.GTLRErrorObjectDomain代码= 403“用户被阻止进行实时流式传输。”   UserInfo = {GTLRStructuredError = GTLRErrorObject 0x28027ad30:{code:403   错误:[1]消息:“用户被阻止进行实时流式传输。”},   NSLocalizedDescription =用户被禁止直播。}

我今天开始收到此错误。以前,一切都很好。我已经对多个帐户进行了测试,但没有任何运气。

代码:

GTLRYouTube_LiveBroadcastSnippet *broadcastSnippet= [[GTLRYouTube_LiveBroadcastSnippet alloc] init];
    [broadcastSnippet setTitle:title];
    [broadcastSnippet setScheduledStartTime:[GTLRDateTime dateTimeWithDate:self.beginOfStream]]; // current date + 1 minute.
    [broadcastSnippet setScheduledEndTime:[GTLRDateTime dateTimeWithDate:[NSDate dateWithTimeIntervalSinceNow:80000]]];

    GTLRYouTube_LiveBroadcastStatus *status = [[GTLRYouTube_LiveBroadcastStatus alloc] init];
    [status setPrivacyStatus:[StreamSettings youtubeStringForPrivacyStatus:[privacyStatus intValue]]];

    GTLRYouTube_LiveBroadcastContentDetails *details = [self streamDetailsWith:latency];

    GTLRYouTube_LiveBroadcast *broadcast = [[GTLRYouTube_LiveBroadcast alloc] init];
    [broadcast setKind:@"youtube#liveBroadcast"];
    [broadcast setSnippet:broadcastSnippet];
    [broadcast setStatus:status];

    GTLRYouTubeQuery_LiveBroadcastsInsert *query = [GTLRYouTubeQuery_LiveBroadcastsInsert queryWithObject:broadcast
                                                                                part:@"id, snippet, contentDetails,status"];
    GTLRYouTubeService *service = self.youTubeService;
    __strong id <YouTubeHelperDelegate> strongDelegate = self.delegate;
    [service executeQuery:query completionHandler:^(GTLRServiceTicket *ticket,
                                                    GTLRYouTube_LiveBroadcast *returnedBrocast,
                                                    NSError *error) {
        if (error) {
            NSLog(@"%@", error); //Here is place I got an error 
        }
}];

1 个答案:

答案 0 :(得分:1)

如果登录的用户不超过100个订阅者,则无法使用移动应用程序上线,如链接中所述:

https://support.google.com/youtube/answer/2853834?hl=en