Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload Video (FB Task #439513) #4

Closed
nathanspector opened this issue Aug 17, 2010 · 13 comments
Closed

Upload Video (FB Task #439513) #4

nathanspector opened this issue Aug 17, 2010 · 13 comments

Comments

@nathanspector
Copy link

Because upload video is not yet supported with graph's i was bouncing it off the REST API, as it turns out I ran into the issue that "This method must run on api-video.facebook.com", most likely I assume the new SDK doesnt know or detect which one to use and always uses api.facebook.com. Is there an easy solution to this? Or am i possibly doing something wrong?

@yujuan
Copy link

yujuan commented Aug 17, 2010

Thank you for your report!

Our SDK does not support video upload yet, When you call video.upload, you need to make the video.upload call to http://api-video.facebook.com , see ref
http://developers.facebook.com/docs/reference/rest/video.upload
We will continue work on that to support video, at the same time you can also write your own code to upload video.

Thanks!

@prashanth84
Copy link

hi yujuan,
i have implemented the video uploading feature, but seems to be not working. When i send request to the url http://api-video.facebook.com/resetserver.php it returning me some bunch of html string as response.. Please find the attached code

  • (NSMutableData *)generatePostBody {
    NSMutableData *body = [NSMutableData data];
    NSString *endLine = [NSString stringWithFormat:@"\r\n--%@\r\n", kStringBoundary];
    NSMutableDictionary *dataDictionary = [NSMutableDictionary dictionary];

    [self utfAppendBody:body data:[NSString stringWithFormat:@"--%@\r\n", kStringBoundary]];

    for (id key in [_params keyEnumerator]) {

    if (([[_params valueForKey:key] isKindOfClass:[UIImage class]])
    ||([[_params valueForKey:key] isKindOfClass:[NSData class]])) {

    [dataDictionary setObject:[_params valueForKey:key] forKey:key];
    continue;
    

    }

    [self utfAppendBody:body
    data:[NSString
    stringWithFormat:@"Content-Disposition: form-data; name="%@"\r\n\r\n",
    key]];
    [self utfAppendBody:body data:[_params valueForKey:key]];

    [self utfAppendBody:body data:endLine];
    }

    if ([dataDictionary count] > 0) {
    for (id key in dataDictionary) {
    NSObject dataParam = [dataDictionary valueForKey:key];
    if ([dataParam isKindOfClass:[UIImage class]]) {
    NSData
    imageData = UIImagePNGRepresentation((UIImage*)dataParam);
    [self utfAppendBody:body
    data:[NSString stringWithFormat:
    @"Content-Disposition: form-data; filename="%@"\r\n", key]];
    [self utfAppendBody:body
    data:[NSString stringWithString:@"Content-Type: image/png\r\n\r\n"]];
    [body appendData:imageData];
    } else {
    NSAssert([dataParam isKindOfClass:[NSData class]],
    @"dataParam must be a UIImage or NSData");

        NSString *filename = [[NSString alloc] initWithData:(NSData*)dataParam encoding:NSUTF8StringEncoding];
    
        NSData *videoData = [NSData dataWithContentsOfFile:filename];
    
        [self utfAppendBody:body
                       data:[NSString stringWithFormat:@"Content-Disposition: form-data; filename=\"%@\"\r\n",[filename lastPathComponent]]];
        [self utfAppendBody:body
                       data:[NSString stringWithFormat:@"Content-Type: video/%@\r\n\r\n",[[filename lastPathComponent] pathExtension]]];
        [body appendData:videoData];
        [filename release];
    
    }
    [self utfAppendBody:body data:endLine];          
    

    }
    }

    return body;
    }

@yujuan
Copy link

yujuan commented Sep 23, 2010

Our video upload tier is having some issue and got quite high failure rate. We have an engineer devoted working on solving this issue. We will not include the video upload in the SDK until that issue solved. For your url , you mean l http://api-video.facebook.com/restserver.php instead of l http://api-video.facebook.com/resetserver.php isn't it?

@prashanth84
Copy link

yes that is true.. thanks for your update.How long it will take to fix this issue.

@sivatejab
Copy link

Thanks for the reply.
I need a clarification. I have downloaded applications from itunes like iuploader,etc which are uploading videos to the facebook still. what sdk they are using ? How they are doing the things.

@jasongregori
Copy link

Any updates on this? I'm using the old SDK only because it supports video uploading. But it's starting to get a little wonky...

@prashanth84
Copy link

@jasongregori
No updates from facebook guys yet..... am waiting for that too.

@kmadhukishore
Copy link

Hello all,

Any one figured out how to upload the videos to face book?
Any help is really appreciated.

Thanks in advance,
Madhu.

@rgaino
Copy link

rgaino commented Nov 16, 2010

+1 for this, I'm trying to implement this feature as well.

@cancelself
Copy link

They are likely using http://developers.facebook.com/docs/reference/rest/video.upload.

I'll opened an issue to get this added to new SDK.

FB Task #439513

@zoul
Copy link

zoul commented Nov 19, 2010

I’ve added a pull request for a class that does video uploads using a combination of the old and the new API, see #153.

@jasongregori
Copy link

very cool, thanks

@bgold
Copy link
Contributor

bgold commented Dec 15, 2010

We're tracking this in task #153.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants