TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2016 |
Maintained by Kjartan Vestvik.
SynqLib is a simple Objective-C library that enables upload of videos to the SYNQ platform.
The library uses AFNetworking 3 for communicating with the server. It utilizes a background configured NSURLSession to manage video uploads. This makes the upload continue regardless of whether the app is in the foreground or background.
To run the example project, clone the repo, and run pod install
from the Example directory first.
SynqLib is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SynqLib"
#import <SynqLib/SynqLib.h>
// Create SQVideoUpload objects for each video to upload,
// add PHAsset for the videos
SQVideoUpload *video1 = [[SQVideoUpload alloc] initWithPHAsset:nil];
SQVideoUpload *video2 = [[SQVideoUpload alloc] initWithPHAsset:nil];
// Add upload parameters for each video, as a dictionary
// This would be the parameters returned from Synq API function video/upload, and must contain the following keys:
// "acl"
// "key"
// "Policy"
// "action"
// "Signature"
// "Content-Type"
// "AWSAccessKeyId"
NSDictionary *uploadParams1;
NSDictionary *uploadParams2;
[video1 setUploadParameters:uploadParams1];
[video2 setUploadParameters:uploadParams2];
// Finally, add all SQVideoUpload objects to an array
NSArray *assetsArray = [NSArray arrayWithObjects:video1, video2, nil];
// Use the singleton instance to initiate an upload for the video array
[[SynqLib sharedInstance] uploadVideoArray:assetsArray
uploadProgressBlock:^(double progress) {
NSLog(@"Upload progress: %f", progress);
// Report progress to UI
} uploadSuccess:^(NSURLResponse *response) {
NSLog(@"Upload success: %@", response);
// Handle upload success
} uploadError:^(NSError *error){
NSLog(@"Upload error: %@", error);
// Handle upload error
}];
This library requires iOS 8 or above
Kjartan, [email protected]
SynqLib is available under the MIT license. See the LICENSE file for more info.