TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Aug 2016 |
SPMSupports SPM | ✗ |
Maintained by noppefoxwolf.
Depends on: | |
STTwitter | >= 0 |
SwiftTask | >= 0 |
Unbox | >= 0 |
To run the example project, clone the repo, and run pod install
from the Example directory first.
TVUploader is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TVUploader"
let videoUrl1 = NSBundle.mainBundle().URLForResource("sample1", withExtension: "mp4")!
let info1 = TVVideoInfo(videoUrl: videoUrl1)
print(info1)
infomation example
---- Video Track Infomation ---
File Path: file://TVUploader_Example.app/sample.mp4
Duration: 2.83182222222222sec
File Size: 0.0930662MB (97587B)
Dimension: 320.0 x 180.0 [width x height]
Aspect Ratio: 1.77778
Channel Count: 2
FPS: 24.0128
--------------------------
TVValidater(videoInfo: info1, postType: .Async).validationCheckTask().success { (safes) in
print(safes)
}.failure { (error, isCancelled) in
print(error)
}
validation result example of success
[TVUploader.TVValidater.FormatValid.durationValid, TVUploader.TVValidater.FormatValid.fileSizeValid, TVUploader.TVValidater.FormatValid.dimensionsValid, TVUploader.TVValidater.FormatValid.aspectRatioValid, TVUploader.TVValidater.FormatValid.frameRateValid, TVUploader.TVValidater.FormatValid.audioChannelValid, TVUploader.TVValidater.FormatValid.audioFormatValid]
validation result example of failure It will be called at the time verification fails.
Optional(TVUploader.TVValidater.FormatError.InvalidDuration)
Supports synchronous and asynchronous(chunked) upload.
let api = TVUploaderAPI(OAuthConsumerKey: "",
consumerSecret: "",
oauthToken: "",
oauthTokenSecret: "")
api.asyncVideoUpload(videoUrl1).success { (mediaId) -> TVUploaderAPI.PostTask in
return api.postStatusUpdateTask("", mediaId: mediaId)
}.success { (_) in
print("video1 upload success")
}.failure { (error, isCancelled) in
print("video1 upload failure")
}
Tomoya Hirano, [email protected]
TVUploader is available under the MIT license. See the LICENSE file for more info.