vimeo / vimeoupload Goto Github PK
View Code? Open in Web Editor NEWThe Vimeo iOS Upload SDK
License: MIT License
The Vimeo iOS Upload SDK
License: MIT License
Can you please update us on plans to support Swift 3.2 or Swift 4 so that we are able to use Vimeo on Xcode 9.
A brief but thorough description of the issue.
Detailed steps to reproduce the issue.
What do you expect to happen as a result of the reproduction steps?
What currently happens as a result of the reproduction steps?
i want to integrate Vimeo in my project developed in Objective C. is there any way to integrate this?
I am currently receiving multiple compiler errors with VimeoUpload. I already followed the instructions on using VimeoNetworking and VimeoUpload as submodules.
I also tried to add VimeoNetworking and VimeoUpload in a new/empty project, I am still having the same issue.
Can anyone point me to a fix/solution? Thanks!
I am getting this error and not able to run project and showing this error from pod.
I just clone folder to submodule folder and install pod and get this error.
see this error
http://prntscr.com/oyibo8
best
A brief but thorough description of the issue.
Detailed steps to reproduce the issue.
What do you expect to happen as a result of the reproduction steps?
What currently happens as a result of the reproduction steps?
Cannot find a 'VimeoUpload' in cocoapods
Unable to find a specification for VimeoUpload
my cocoapods version is Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb
also I can't find it in https://cocoapods.org/
Most of the files within the VimeoUpload pod only have one or two imports of Foundation or UIKit, none of them contain imports of AFNetworking, Or VIMNetworking. What Am I missing here? How has this compiled for your team? Most files have an error where it's missing an import.
Any clues how we can use VimeoUpload on a project which already uses AFNetworking - but v. 3 (the latest release)?
Thank you!
While i am uploading video through this example, i am getting fatal error: unexpectedly found nil while unwrapping an Optional value
I am only passing OAUTH_TOKEN getting from https://developer.vimeo.com/apps.
I am able to see all my videos but not able to upload.
Please help me.
@objc func didTapUpload(_ sender: UIBarButtonItem)
{
let title = self.titleTextField.text
let description = self.descriptionTextView.text
self.videoSettings = VideoSettings(title: title, description: description, privacy: "Nobody", users: nil, password: nil)
if self.operation?.state == .executing
{
self.operation?.videoSettings = self.videoSettings
self.activityIndicatorView.startAnimating() // Listen for operation completion, dismiss
}
else if let error = self.operation?.error
{
self.presentOperationErrorAlert(with: error)
}
else
{
if let video = self.video, let viewPrivacy = video.privacy?.view, viewPrivacy != VideoSettingsViewController.PreUploadViewPrivacy
{
NotificationCenter.default.post(name: Notification.Name(rawValue: type(of: self).UploadInitiatedNotification), object: video)
self.dismiss(animated: true, completion: nil)
}
else
{
self.activityIndicatorView.startAnimating()
self.applyVideoSettings()
}
}
}
This is my upload function here i set privacy to "Nobody","Anybody","VIMPrivacy_Private" Nothing works for me could anyone help me to get this out !!!!
Cannot compile VimeoUpload
After adding VimeoUpload and build it, It show 65 error😢
I have added files all swift files in my Objective-C project from VimeoUpload folder
I have added #import “-Swift.h” in my project
To subclass VimeoUpload, I am adding @objc in the class definition and it gives me following error
"Generic subclasses of '@objc' classes cannot have an explicit '@objc' attribute because they are not directly visible from Objective-C.”
That is because VimeoUpload is generic class, Is there any straightforward way to use this with Objective-C project
How do I get started with this library? The Cocoapods area says "TODO." How should I add VimeoNetworking to my app?
When I install with
pod 'VimeoUpload', :git => 'https://github.com/vimeo/VimeoUpload.git', :branch => 'CAM-354' pod 'VimeoNetworking', :git => 'https://github.com/vimeo/VimeoNetworking.git', :branch => 'cameo'
I get a "Use of unresolved identifier VimeoUpload" error when I try to upload a video in a view controller.
When I install with
pod 'VimeoUpload', :git => 'https://github.com/vimeo/VimeoUpload.git', :branch => 'CAM-354'
pod 'VimeoNetworking', :git => 'https://github.com/vimeo/VimeoNetworking.git', :branch => 'master'
I get a "include of non-modular header inside framework module VimeoNetworking.VimeoNetworking" error in the VimeoNetworking.h header file.
When I install with
pod 'VimeoUpload', :git => 'https://github.com/vimeo/VimeoUpload.git', :branch => ‘master’
pod 'VimeoNetworking', :git => 'https://github.com/vimeo/VimeoNetworking.git', :branch => ‘master’
I get the following error:
Unable to satisfy the following requirements:
AFNetworking (= 2.6.3)
required by VIMNetworking/Model (6.0.4)
AFNetworking (= 3.1.0)
required by VimeoNetworking (0.0.1)
vimeo api v3.4 now requires "upload.approach" instead of "type" for POST https://api.vimeo.com/me/videos
Try to upload video
Upload succeeded
Vimeo API return 502 with Error Code: 3116
Hello i want to integrate Vimeo in my project developed in Objective C. is there any way to integrate this??
Thanks..
I included the VimeoUploader into my project using cocoapods as described (using submodules).
When trying to compile my app, the compiler throws several errors (see attached image).
I'm using Xcode 10.2.1, Swift Language Version is set to 4.2
(I tried to get an answer on Stackoverflow, but the question was closed due to being «off topic». The user @rog suggested to open an issue here).
let phAsset = ... // The PHAsset you intend to upload
let operation = PHAssetExportSessionOperation(phAsset: phAsset)
// Optionally set a progress block
operation.progressBlock = { (progress: Double) -> Void in
// Do something with progress
}
operation.completionBlock = {
guard operation.cancelled == false else
{
return
}
if let error = operation.error
{
// Do something with the error
}
else if let exportSession = operation.result
{
// Use the export session to export a copy of the asset (see below)
}
else
{
assertionFailure("error and exportSession are mutually exclusive. This should never happen.")
}
}
The result of this line
let exportSession = operation.result
is type URL, but in your doc, when I try
let operation = ExportOperation(exportSession: exportSession)
I get the error
Cannot convert value of type 'URL' to expected argument type 'AVAssetExportSession'
Do you know why the operation result is not coming back as type AVAssetExportSession?
The result of ExportOperation(exportSession: exportSession) returns an object of type AVAssetExportSession
The result of ExportOperation(exportSession: exportSession)
returns an object of type URL
I'm currently trying to do background upload.
I'm implementing with VimeoUploader<OldUploadDescriptor>
and DescriptorKVObserver
delegate methods.
When backgrounding my app during the upload, then entering foreground again, the upload progress comes to 1.0
Then descriptorProgressDidChange
is called several times, and the last time with an error : "Attempt to construct upload request but the source file does not exist"
I logged both methods of the delegate : descriptorProgressDidChange
and descriptorStateDidChange
:
upload progress 1.0
upload descriptor did change: ready
## video still at /var/mobile/Containers/Data/Application/1E1D019F-66C9-4543-9B12-44298E34EBC9/Documents/video1.mp4
upload descriptor did change: executing
## video still at /var/mobile/Containers/Data/Application/1E1D019F-66C9-4543-9B12-44298E34EBC9/Documents/video1.mp4
upload descriptor did change: executing
##video NOT FOUND at /var/mobile/Containers/Data/Application/1E1D019F-66C9-4543-9B12-44298E34EBC9/Documents/video1.mp4
upload descriptor did change: finished
##video NOT FOUND at /var/mobile/Containers/Data/Application/1E1D019F-66C9-4543-9B12-44298E34EBC9/Documents/video1.mp4
Err upload failed Error Domain=VideoUploadErrorDomain Code=0 "Attempt to construct upload request but the source file does not exist." UserInfo={NSLocalizedDescription=Attempt to construct upload request but the source file does not exist.}
uploader finish with status failed(Error Domain=VideoUploadErrorDomain Code=0 "Attempt to construct upload request but the source file does not exist." UserInfo={NSLocalizedDescription=Attempt to construct upload request but the source file does not exist.})
(I check the video presence with FileManager.default.fileExists
methods)
Why Vimeo upload is failing?
Why Vimeo SDK is removing the source video file?
I am in no way into Swift :) - old school objective c dev and this is why i am posting this - it's probably a silly issue.
Checked out the latest version - and:
The video actually gets uploaded - but the settings (title, description) do not get updated - this is where the app crashes.
Attaching two screenshots - one stopped at the breakpoint before the crash and one after.
It seems the video is nil - but beats me why :) I can only logically guess what is happening by looking at the swift code but that is where my super powers end :)
A brief but thorough description of the issue.
Detailed steps to reproduce the issue.
What do you expect to happen as a result of the reproduction steps?
What currently happens as a result of the reproduction steps?
I am trying to upload a Vimeo to my VimeoAccount. I dragged the VimeoUpload-master source code into my project, and I included 'VIMNetworking' as a pod. Did I set up VimeoUpload incorrectly?
When I run the following code, Xcode's logs show "Create [phAsset identifier]" and "Upload [phAsset identifier]" However, in the example included with the library, when the video successfully uploads, Xcode shows Create, Upload, Activate, and Settings in the logs. Can you please explain what I did incorrectly in this code? Thank you so much!
`import UIKit
import Photos
class ViewController: UIViewController {
var assets = Array<PHAsset>()
let vimeoUpload = VimeoUpload<OldUploadDescriptor>(backgroundSessionIdentifier: "com.vimeo.upload", authToken: "(mytoken)")
override func viewDidLoad() {
super.viewDidLoad()
self.requestCameraRollAccessIfNecessary()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
@IBAction func uploadPressed(sender: AnyObject) {
let options = PHFetchOptions()
options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
let fetchResult = PHAsset.fetchAssetsWithMediaType(.Video, options: options)
fetchResult.enumerateObjectsUsingBlock{ (object: AnyObject?, count: Int, stop: UnsafeMutablePointer<ObjCBool>) in
if let phAsset = object as? PHAsset
{
self.assets.append(phAsset)
}
}
var selectedPHAsset = assets[0]
let operation = PHAssetExportSessionOperation(phAsset: selectedPHAsset as! PHAsset)
// Optionally set a progress block
operation.progressBlock = { (progress: Double) -> Void in
// Do something with progress
}
operation.completionBlock = {
guard operation.cancelled == false else
{
return
}
if let error = operation.error
{
// Do something with the error
print(error)
}
else if let exportSession = operation.result
{
// Use the export session to export a copy of the asset (see below)
// let exportSession = ... // The export session you just generated (see above)
let operation = ExportOperation(exportSession: exportSession)
// Optionally set a progress block
operation.progressBlock = { (progress: Double) -> Void in
// Do something with progress
print(progress)
}
operation.completionBlock = {
guard operation.cancelled == false else
{
return
}
if let error = operation.error
{
// Do something with the error
print(error)
}
else if let url = operation.outputURL
{
// Use the url to start your upload (see below)
print(url)
let assetIdentifier = selectedPHAsset.localIdentifier
let title = "Untitled"
let description = "A really cool video"
let privacy = "nobody"
let videoSettings = VideoSettings(title: title, description: description, privacy: privacy, users: nil, password: nil)
let descriptor = OldUploadDescriptor(url: url, videoSettings: videoSettings)
descriptor.identifier = assetIdentifier
self.vimeoUpload.uploadVideo(descriptor: descriptor)
}
else
{
assertionFailure("error and outputURL are mutually exclusive, this should never happen.")
}
}
operation.start()
}
else
{
assertionFailure("error and exportSession are mutually exclusive. This should never happen.")
}
}
operation.start()
}
private func requestCameraRollAccessIfNecessary()
{
PHPhotoLibrary.requestAuthorization { status in
switch status
{
case .Authorized:
print("Camera roll access granted")
case .Restricted:
print("Unable to present camera roll. Camera roll access restricted.")
case .Denied:
print("Unable to present camera roll. Camera roll access denied.")
default:
// place for .NotDetermined - in this callback status is already determined so should never get here
break
}
}
}
}
`
I had an issue, during the installing process from
(https://paper.dropbox.com/doc/Getting-Started-with-Submodules-as-Development-Pods--A4cDjxURk9yGz6yT1rERpRhqAg-yRpNbPxIOjzGlcEbecuOC)
I've got error in VimeoUpload Submodule file ->
file: ExportOperation.swift
line: 121
if let space = availableDiskSpace, space.int64Value < self.exportSession.estimatedOutputFileLength
// not unwrapped value - space.int64Value
this code can be fixed manually, but is there an opportunity to fix it from your side?
A brief but thorough description of the issue.
Detailed steps to reproduce the issue.
What do you expect to happen as a result of the reproduction steps?
What currently happens as a result of the reproduction steps?
Guys please help with my issue.
I am trying to update Vimeo business logic with new iOS SDK 13 in my app. I did all the items from the scratch in the guide document how to integrate VimeoUpload/VimeoNetworking. But now I faced with problem that Xcode says me that PHAssetExportSessionOperation - use of unresolved identifier. I also add import lines (ViimeoUpload/ VimeoNetworking) in the file where I have a problem. However I did all the things that have been mentioned in the guide document without any warning. How can I solve this problem?
I'm using pod from your develop branch and I'm using:
class NewVimeoUploader: VimeoUploader<UploadDescriptor>
{
private static var APIVersionString: String
{
return "3.4"
}
static let sharedInstance = NewVimeoUploader(backgroundSessionIdentifier: "com.vimeo.upload", accessTokenProvider: { () -> String? in
return "xxxxxxxxxxxx"
}, apiVersion: APIVersionString)
}
The UploadDescriptor
returns video object of VIMVideo
and there is a property link
, but he is not full URL of video just: https://vimeo.com/xxxxxx
. I have a PRO version and I created a new token after upgrade? Can I get a real URL in response or do I need to use VimeoNetworking for fetching real URL?
diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
after pod install, it shows the error below:
[!] Error installing VimeoNetworking
[!] /usr/bin/git clone [email protected]:vimeo/VimeoNetworking.git /var/folders/38/jlhr8mdj7gjb452xbh_qvz2c0000gp/T/d20160624-27718-1wf33rj --template= --single-branch --depth 1 --branch master
Cloning into '/var/folders/38/jlhr8mdj7gjb452xbh_qvz2c0000gp/T/d20160624-27718-1wf33rj'...
Warning: Permanently added the RSA host key for IP address '192.30.252.122' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Download the demo and run
A brief but thorough description of the issue.
Detailed steps to reproduce the issue.
What do you expect to happen as a result of the reproduction steps?
What currently happens as a result of the reproduction steps?
I was able to connect and upload videos using the library but when I deleted the app connection on Vimeo.com (as a test) the app didn't authorize again.
the upload looks like it's working but nothing is uploaded as the app is no longer connected.
I deleted the app on the phone and restarted but it still won't re-authorize the app.
This comes up in the output:
Vimeo upload state : Executing
Vimeo upload state : Finished
Invalid http status code for download task.
And this is in OldVimeoUpload.swift: ( didn't include the actual access code!)
import Foundation
class OldVimeoUpload: VimeoUpload
{
static var VIMEO_ACCESS_TOKEN :String! // = "there's a string of numbers here"
static let sharedInstance = OldVimeoUpload(backgroundSessionIdentifier: "com.slatablellc.slatablevideo") { () -> String? in
return VIMEO_ACCESS_TOKEN // See README for details on how to obtain and OAuth token
}
// MARK: - Initialization
override init(backgroundSessionIdentifier: String, authTokenBlock: AuthTokenBlock)
{
super.init(backgroundSessionIdentifier: backgroundSessionIdentifier, authTokenBlock: authTokenBlock)
}
}
This application or a bundle it contains has the same bundle identifier as this application or another bundle that it contains. Bundle identifiers must be unique
I tried running your sample code. I have changed the bundle identifier as well as token. but everytime i run the app < i get above warning. Not sure what's wrong.
static let sharedInstance = NewVimeoUploader(backgroundSessionIdentifier: "com.xxx.xxx") { () -> String? in
return "XXXXXXXXXXXXXXXXXXXXX197" // See README for details on how to obtain and OAuth token
}
Hi I wanted to know when u are releasing the 1.0 version because in your post from stackoverflow:
http://stackoverflow.com/questions/38339748/how-to-use-vimeo-upload
you wrote in august it will be a cocoa pods version available.
Would be perfect to know when this version will come live :)
Regards
A brief but thorough description of the issue.
Detailed steps to reproduce the issue.
What do you expect to happen as a result of the reproduction steps?
What currently happens as a result of the reproduction steps?
A brief but thorough description of the issue.
Detailed steps to reproduce the issue.
What do you expect to happen as a result of the reproduction steps?
What currently happens as a result of the reproduction steps?
We have been using the VimeoUpload framework for several months now without issue. A few days ago we started getting an error during every upload. The OldUploadDescriptor has it's state change from ready to executing to finished fairly quickly, but there is no videoUri and instead error is set to "Invalid http status code for download task."
I have tried updating the framework to the latest version, but this has not changed anything. Since we started using the framework, the VimeoUploader init method now requires an apiVersion argument, I have tried "", "2.0", and "3.0".
I use our client ID, client secret, and access token to authenticate and get back an account, no problems there. Later I configure a VimeoUploader and OldUploadDescriptor (has not changed in months) and start the upload, then I check on the upload every 0.25 seconds.
The OldUploadDescriptor progress updates until the state changes to .finished, and the videoUri is set.
The progress does not update, the state changes to .finished but error is set instead of videoUri.
More info on the error: Error Domain=VimeoResponseSerializerErrorDomain Code=0 "Invalid http status code for download task." UserInfo={VimeoErrorDomain=CreateVideoErrorDomain, NSLocalizedDescription=Invalid http status code for download task.}
I have checked your comment, but still can't get the video id like "https://vimeo.com/164824324" after uploading video.
looks like "https://1511928471.cloud.vimeo.com/upload?ticket_id=59821e7edc5840322fc360b63d9414c7_45995664&video_file_id=520623428&signature=ec0ce3b5852802957cc1e19c2cccbfa8&v6=1".
I have also checked the .Active state... but no luck.
can you help me?
I have a project which is written in Objective C .How can i integrate in Objective C Project. Urgent help..!!!
A brief but thorough description of the issue.
Detailed steps to reproduce the issue.
What do you expect to happen as a result of the reproduction steps?
What currently happens as a result of the reproduction steps?
I followed example 'VimeoUpload-iOS'.
I don't know which part wrong. Please answers me.
Here is my code
fileprivate func vimeoSessionStart()
{
if self.meOperation != nil
{
return
}
let sessionManager = NewVimeoUploader.sharedInstance.foregroundSessionManager
let operation = MeOperation(sessionManager: sessionManager)
operation.completionBlock = { [weak self] () -> Void in
DispatchQueue.main.async(execute: { [weak self] () -> Void in
guard let strongSelf = self else
{
return
}
strongSelf.meOperation = nil
if operation.isCancelled == true
{
return
}
if operation.error != nil
{
return
}
strongSelf.me = operation.result!
})
}
self.meOperation = operation
operation.start()
}
fileprivate func vimeoStartOperation(_ asset: PHAsset) {
guard let me = self.me else { return }
let sessionManager = NewVimeoUploader.sharedInstance.foregroundSessionManager
self.videoSettings = VideoSettings(title: "ABC",
description: "description",
privacy: "nobody",
users: nil, password: nil)
let operation = PHAssetCloudExportQuotaCreateOperation(me: me, phAsset: asset, sessionManager: sessionManager, videoSettings: videoSettings)
operation.downloadProgressBlock = { (progress: Double) -> Void in
print(String(format: "Download progress: %.2f", progress)) // TODO: Dispatch to main thread
}
operation.exportProgressBlock = { (exportSession: AVAssetExportSession, progress: Double) -> Void in
print(String(format: "Export progress: %.2f", progress))
}
operation.completionBlock = { [weak self] () -> Void in
DispatchQueue.main.async(execute: { [weak self] () -> Void in
guard let strongSelf = self else
{
return
}
if operation.isCancelled == true
{
return
}
if operation.error == nil
{
strongSelf.videoUrl = operation.url!
strongSelf.uploadTicket = operation.uploadTicket!
strongSelf.startUpload(asset)
}
})
}
self.operation = operation
self.operation?.start()
}
fileprivate func startUpload(_ asset: PHAsset)
{
let url = self.videoUrl!
let uploadTicket = self.uploadTicket!
let assetIdentifier = asset.localIdentifier
let descriptor = UploadDescriptor(url: url, uploadTicket: uploadTicket)
descriptor.identifier = assetIdentifier
NewVimeoUploader.sharedInstance.uploadVideo(descriptor: descriptor)
// Try HTTP put upload
ApiManager.sharedManager.uploadVideoToVimeo(url, secureUploadLink: uploadTicket.uploadLinkSecure) { (error, completeUrl) in
if let completeUrl = completeUrl {
print("completeUrl = \(completeUrl)")
}
}
}
Can this code be extended to upload to another provider like Cloudinary?
I Use a really basic approach for this and try 3 times and every time tittle is "Untitled" even If I change VideoSetting in code, not sure what to do here. I can not run your examples because Xcode gives me some errors after build. The description is also missing, only the privacy works as I can see.
P.S.
Im using this Pod:
pod 'VimeoUpload', :git => '[email protected]:vimeo/VimeoUpload.git', :branch => 'develop'
override func viewDidLoad() {
super.viewDidLoad()
guard let path = Bundle.main.path(forResource: "joy", ofType:"mp4") else {
debugPrint("video.m4v not found")
return
}
let urlll = URL(fileURLWithPath: path)
let title = "New Title!"
let description = "A really cool video"
let privacy = "public"
let videoSettings = VideoSettings(title: title, description: description, privacy: privacy, users: nil, password: nil)
let descriptor = OldUploadDescriptor(url: urlll, videoSettings: videoSettings) //OldUploadDescriptor(url: fileUrl, videoSettings: self.videoSettings)
descriptor.identifier = "AnotherOne"
descriptor.addObserver(self, forKeyPath: type(of: self).StateKeyPath, options: .new, context: &self.stateKVOContext)
descriptor.addObserver(self, forKeyPath: type(of: self).ProgressKeyPath, options: .new, context: &self.progressKVOContext)
OldVimeoUploader.sharedInstance?.uploadVideo(descriptor: descriptor)
}
Title to be the one I enter
Title is always: "Untitled"
Can not install pod
pod "VimeoUpload"
pod install
pod installation
pod install error
Hi, I tried to install
pod "VimeoUpload"
and I'm getting this error:
Analyzing dependencies
[!] Unable to find a specification for VimeoUpload
You have either:
pod repo update
or with pod install --repo-update
.I even tried this:
pod 'VimeoUpload'
pod 'VimeoNetworking', '~> 4.1.0'
but same error, can someone help? thanks
Hello,
Could you confirm me that the API is compatible with swift 3.0 please? I saw on Github that it's ready. Do you know if it works properly? Thank you
When trying to upload a video with mov extension to Vimeo, the export session throws this error:
Error Domain=AVFoundationErrorDomain Code=-11838 "Operation Stopped" UserInfo={NSLocalizedFailureReason=The operation is not supported for this media., NSLocalizedDescription=Operation Stopped, NSUnderlyingError=0x10f9d60c0 {Error Domain=NSOSStatusErrorDomain Code=-16976 "(null)"}}
FYI: It's working on a simulator running iOS 13.3 and on real devices running iOS 12.4.4
and I am using Xcode 11.3 and iPhone 11 Pro Max
It should work fine and upload successfully
The exportSession fails and return an error same as in description above
I'm trying to get upload progress update using KVO approach, but my observeValue() never gets called, after registering observer using addObserver() and waiting for some time, the execution never come under observeValue() method.
Below is my VimeoHelper class, please have a look.
import Foundation
import VimeoUpload
protocol VideoUploadListener {
func onVideoUploadUpdate(progress: Double)
func onVideoUploadSuccess(media:PostMedia)
func onVideoUploadFailure()
}
class VimeoHelper:NSObject {
private static let Identifier = "com.ios.weapp"
private static let AccessToken = "my_access_token"
private static let ProgressKeyPath = "progressObservable"
private static let StateKeyPath = "stateObservable"
var postMedia:PostMedia?
private var listener:VideoUploadListener?
private var vimeoUpload:VimeoUploader<OldUploadDescriptor>?
private var descriptor:OldUploadDescriptor?
private var progressKVOContext = UInt8()
private var stateKVOContext = UInt8()
init(postMedia:PostMedia, listener:VideoUploadListener) {
self.postMedia = postMedia
self.listener = listener
}
private func initVimeo() {
vimeoUpload = VimeoUploader<OldUploadDescriptor>(backgroundSessionIdentifier: VimeoHelper.Identifier, accessToken: AccessToken, apiVersion: "3.3.1")
let videoSettings = VideoSettings(title: "Untitled Video", description: "N/A", privacy: "anybody", users: nil, password: nil)
descriptor = OldUploadDescriptor(url: (postMedia?.fileUrl)!, videoSettings: videoSettings)
}
public func startUpload() {
initVimeo()
vimeoUpload?.uploadVideo(descriptor: descriptor!)
descriptor = vimeoUpload?.descriptor(for: VimeoHelper.Identifier)
descriptor?.addObserver(self, forKeyPath: VimeoHelper.ProgressKeyPath, options: .new, context: &self.progressKVOContext)
descriptor?.addObserver(self, forKeyPath: VimeoHelper.StateKeyPath, options: .new, context: &self.stateKVOContext)
}
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if let keyPath = keyPath {
switch (keyPath, context) {
case (VimeoHelper.ProgressKeyPath, &self.progressKVOContext):
if let progress = change?[.newKey] as? Double {
//Call Listener
self.listener?.onVideoUploadUpdate(progress: progress)
}
break;
case (VimeoHelper.StateKeyPath, &self.stateKVOContext):
let stateRaw = (change?[.newKey] as? String) ?? DescriptorState.ready.rawValue;
let state = DescriptorState(rawValue: stateRaw)!
//Call Listener
if state == .finished {
self.listener?.onVideoUploadSuccess(media: self.postMedia!)
}
break;
default:
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
}
} else {
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
}
}
}
A class "VIMThumbnailUploadTicket" is used by two classes "VimeoResponseSerializer+Thumbnail.swift" and "CAMUploadDescriptor.swift" on following lines:
VimeoResponseSerializer+Thumbnail.swift : 14, 29, 100 and 105
CAMUploadDescriptor.swift : 20
Unable to use VimeoUpload framework code with Objective-C suing Xcode 8.0
What do you expect to happen as a result of the reproduction steps?
There should be class named "VIMThumbnailUploadTicket".
What currently happens as a result of the reproduction steps?
No "VIMThumbnailUploadTicket" present, so unable to use VimeoUpload framework.
Please try to add this file ASAP.
Thanks!!!
A brief but thorough description of the issue.
Detailed steps to reproduce the issue.
What do you expect to happen as a result of the reproduction steps?
What currently happens as a result of the reproduction steps?
AuthenticationController.clientCredentialGrant does not have a VIMUser associated with the VIMAccount.
I'm pretty confident that this isn't an actual issue with your library but I'm raising a ticket as I there is no resources addressing this.
Let users upload videos to our account, currently a Vimeo Plus account, but will be upgraded to Pro before release. These videos will be accessible throughout out app to any users of our app.
pod 'VimeoUpload', :git => 'https://github.com/vimeo/VimeoUpload.git', :branch => 'CAM-354'
pod 'VimeoNetworking', :git => 'https://github.com/vimeo/VimeoNetworking.git', :branch => 'cameo'
I cant use the master branch because of this issue:
https://github.com/vimeo/VimeoNetworking/issues/34
Which although is fixed, still causes me issues.
Currently within the VimeoUploadFramework the only publicly accessible api for creating a video on the Vimeo servers is the PHAssetCloudExportQuotaCreateOperation(me: user, phAsset: asset, sessionManager: session), this takes a user and a session. Unfortunately when we request authorization we never receive a User and therefore can never upload
This is the request authorization code used:
class Vimeo: VimeoUploader<UploadDescriptor>
{
static let BackgroundIdentifier = "com.vimeo.upload"
static let sharedInstance = Vimeo(backgroundSessionIdentifier: BackgroundIdentifier, descriptorManagerDelegate: nil) {
return ApiKeys.VimeoUpload
}
var session: VimeoSessionManager?
var user: VIMUser?
override init(backgroundSessionIdentifier: String, descriptorManagerDelegate: DescriptorManagerDelegate?, accessTokenProvider: VimeoRequestSerializer.AccessTokenProvider) {
super.init(backgroundSessionIdentifier: backgroundSessionIdentifier, descriptorManagerDelegate: descriptorManagerDelegate, accessTokenProvider: accessTokenProvider)
}
func authenticate(completion: (user: VIMUser?)->Void ){
if let user = self.user {
completion(user: user)
}
let scopes = [Scope.Private, Scope.Public, Scope.Create, Scope.Upload]
let config = AppConfiguration(clientIdentifier: "xxx", clientSecret: "xx/xxx/xx", scopes: scopes)
let client = VimeoClient(appConfiguration: config)
session = VimeoSessionManager.backgroundSessionManager(identifier: self.dynamicType.BackgroundIdentifier, appConfiguration: config)
let authentication = AuthenticationController(client: client)
authentication.clientCredentialsGrant { (result) in
switch result {
case .Failure(let error):
print(error)
case.Success(let client):
print(client)
if client.isAuthenticated() {
self.user = client.user
}
}
completion(user: self.user)
}
}
}
Am I supposed to use PHAssetCloudExportQuotaCreateOperation?
Is there anything wrong with our set up?
Am I using the incorrect branch?
Thanks, David.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.