小编inn*_*pps的帖子

Youtube API身份验证 - Iphone

我正在尝试使用youtube api的示例代码上传视频.当我按下上传按钮时,进度条完成其过程,但一旦到达结束点我就会收到错误.错误描述如下:

YouTube测试[2149:f803]错误 - 错误域= com.google.GDataServiceDomain代码= 400"无法完成操作.(com.google.GDataServiceDomain错误400.)"UserInfo = 0x69d5bd0 {}

这是按下上传按钮的代码

- (IBAction)uploadPressed:(id)sender {
    [self.view resignFirstResponder];
    NSString *devKey = [mDeveloperKeyField text];

    GDataServiceGoogleYouTube *service = [self youTubeService];
    [service setYouTubeDeveloperKey:devKey];

    NSString *username = [mUsernameField text];
    NSString *clientID = [mClientIDField text];

    NSURL *url = [GDataServiceGoogleYouTube youTubeUploadURLForUserID:username
                                                             clientID:clientID];

    // load the file data
    NSString *path = [[NSBundle mainBundle] pathForResource:@"YouTubeTest" ofType:@"m4v"]; 
    NSData *data = [NSData dataWithContentsOfFile:path];
    NSString *filename = [path lastPathComponent];

    // gather all the metadata needed for the mediaGroup
    NSString *titleStr = [mTitleField text]; …
Run Code Online (Sandbox Code Playgroud)

iphone upload youtube-api ios ios-simulator

7
推荐指数
1
解决办法
1833
查看次数

标签 统计

ios ×1

ios-simulator ×1

iphone ×1

upload ×1

youtube-api ×1