-
Notifications
You must be signed in to change notification settings - Fork 78
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
Share Video feature #49
Comments
Only on Android at this time. |
ios implementation #60 |
Hoping to implement this as soon as it is merged! |
As you can see this feature require additional testing and maybe some changes, could you please do it if you can |
I can do some testing when I am ready to test my new project on iOS. I am currently just developing on Android, but I will be sure to work this out when I get to that point. |
when #60 will be merged, sharing video will be posible on ios 8+ based on Photos Framework and PHAsset. func saveVideoToPhotoLibrary(command: CDVInvokedUrlCommand) {
NSLog("CDVMediaKit#saveVideoToPhotoLibrary()")
let filePath = String(command.argumentAtIndex(0) as! NSString)
NSLog(filePath)
if filePath.isEmpty{
NSLog("error filePath is empty")
}
var fileURL = NSURL(string: filePath)!
if !fileURL.fileURL {
fileURL = NSURL(fileURLWithPath: filePath)
}
var localIdentifier:String? = nil
PHPhotoLibrary.sharedPhotoLibrary().performChanges({ () -> Void in
let createAssetRequest: PHAssetChangeRequest = PHAssetChangeRequest.creationRequestForAssetFromVideoAtFileURL(fileURL)!
let placeholder = createAssetRequest.placeholderForCreatedAsset
localIdentifier = placeholder?.localIdentifier
}, completionHandler: { (success, error) -> Void in
if success {
let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAsString: localIdentifier);
self.commandDelegate!.sendPluginResult(pluginResult, callbackId: command.callbackId);
}
else {
let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: error?.localizedDescription);
self.commandDelegate!.sendPluginResult(pluginResult, callbackId: command.callbackId);
}
})
} This func take a path to video in my application tmp folder, save it to sharedPhotoLibrary and return local identifier string, which is similar to "24320B60-1F52-46AC-BE4C-1202F02B9D00/L0/001", when you have local identifier pass it to Instagram.shareAsset and you will see Instagram app with pre selected video. |
I see that iOS now has the method |
We could add a |
Would love this. You are suggesting seperate methods for iOS and Android. Would it not be better to unify the JS API across both platforms with one method name or are they going to behave very differently? |
It might work with only one method. In the long term the API needs to be reworked as so many things are not supported anymore by Instagram. |
Sorry if I missed this, but according to the documentation video sharing is only available via iOS via the |
Hi, any updates on this one? Also, how did you guys get the |
Is there any chance at sharing videos to instagram.
The text was updated successfully, but these errors were encountered: