TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jan 2015 |
Maintained by Bruno Celeste.
Run pod install
to install the dependency.
Use the API Request Builder to generate a config file that match your specific workflow.
Example of heywatch.conf
:
var s3 = s3://accesskey:secretkey@mybucket
set source = http://yoursite.com/media/video.mp4
set webhook = http://mysite.com/webhook/heywatch
-> mp4 = $s3/videos/video.mp4
-> webm = $s3/videos/video.webm
-> jpg_300x = $s3/previews/thumbs_#num#.jpg, number=3
Here is the Objective-C code to submit the config file:
#import "HeyWatch.h"
NSString *apiKey = @"api-key";
// Reading the config from the heywatch.conf file
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"heywatch" ofType:@"conf"];
NSError *error;
NSString *config = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error];
if(error) {
NSLog(@"Error reading config file: %@", error.localizedDescription);
return;
}
[HeyWatch submit:config withApiKey:apiKey complete:^(id job, NSError *error) {
if([[job objectForKey:@"status"] isEqualToString:@"ok"]) {
NSLog(@"ID: %@", [job objectForKey:@"id"]);
} else {
NSLog(@"Error (%@): %@", [job objectForKey:@"error_code"], [job objectForKey:@"message"]);
}
}];
Released under the MIT license.