Skip to content

Commit

Permalink
Merge pull request #1 from vzaar/wip-dev
Browse files Browse the repository at this point in the history
[WIP] - Amz sig v4, subtitles, image frame
  • Loading branch information
sambias authored Dec 14, 2018
2 parents 9a2effe + d7ea7d9 commit 29cb75b
Show file tree
Hide file tree
Showing 31 changed files with 1,869 additions and 62 deletions.
92 changes: 91 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Video Hosting For Business.
* It allows your customers to upload their own videos via the vzaar API.
* Pull information from vzaar databases and combine them with your app's own data.
* For instance sync your product catalogue with your videos so that videos always appear on the right product page.
* Version 1.0.4
* Version 1.1.0

## Documentation ##

Expand Down Expand Up @@ -62,6 +62,7 @@ vzaarGetVideosParameters.per_page = 50
Vzaar.sharedInstance().getVideos(vzaarGetVideosParameters: vzaarGetVideosParameters, success: { (vzaarVideos) in
self.videos = vzaarVideos
//Handle UI response in Main Thread
self.tableView.reloadData()
}, failure: { (vzaarError) in
Expand Down Expand Up @@ -512,6 +513,95 @@ print(vzaarError)
print(error)
}
```
## IMAGE FRAME ##
### Set Image Frame ###

```
#!swift
let params = VzaarUpdateImageFrameParameters(id: Int32(videoId))
Vzaar.sharedInstance().updateImageFrame(vzaarUpdateImageFrameParameters: params, success: { (vzaarVideo) in
//Handle video from response
}, failure: { (vzaarError) in
print(vzaarError)
}) { (error) in
print(error)
}
```
### Upload Image Frame ###
```
let params = VzaarUploadImageFrameParameters(id: Int32(self.videoId), image: image)
Vzaar.sharedInstance().uploadImageFrame(vzaarUploadImageFrameParameters: params, success: { (vzaarVideo) in
//Handle video from response
}, failure: { (vzaarError) in
print(vzaarError)
}) { (error) in
print(error)
}
```

## SUBTITLES ##
### Get Subtitles ###

```
let params = VzaarGetSubtitlesParameters(id: videoId)
Vzaar.sharedInstance().getSubtitles(vzaarGetSubtitlesParameters: params, success: { (vzaarSubtitles) in
//Handle subtitles array
}, failure: { (vzaarError) in
print(vzaarError)
}) { (error) in
print(error)
}
```
### Create Subtitle ###
```
let params = VzaarPostSubtitlesParameters(id: videoId)
params.code = languageCode //example: en , fr, de etc...
params.content = subtitlesContent //You can use either content or file parameter to create a Subtitle. File parameter is the fullPath to the subtitles file.
Vzaar.sharedInstance().createSubtitle(vzaarPostSubtitlesParameters: params, success: { (vzaarSubtitle) in
//Handle subtitle from response
}, failure: { (vzaarError) in
print(vzaarError)
}) { (error) in
print(error)
}
```
### Update Subtitle ###
```
let params = VzaarUpdateSubtitleParameters(id: videoId, subtitle: Int32(subtitleId))
params.code = languageCode //example: en , fr, de etc...
params.content = subtitlesContent //You can use either content or file parameter to create a Subtitle. File parameter is the fullPath to the subtitles file.
Vzaar.sharedInstance().updateSubtitle(vzaarUpdateSubtitleParameters: params, success: { (vzaarSubtitle) in
//Handle subtitle from response
}, failure: { (vzaarError) in
print(vzaarError)
}) { (error) in
print(error)
}
```
### Delete Subtitle ###
```
let params = VzaarDeleteSubtitlesParameters(id: videoId, subtitle: Int32(subtitleId))
Vzaar.sharedInstance().deleteSubtitle(vzaarDeleteSubtitlesParameters: params, success: {
//Handle UI subtitle removal
}, failure: { (vzaarError) in
print(vzaarError)
}) { (error) in
print(error)
}
```

### How do I get set up for an Objective-c project ###

* If your project is in objective-c you have to use the specific version of the pod '1.0.1-objc' to access the classes and properties through the bridge headers.
Expand Down
22 changes: 19 additions & 3 deletions TestVzaar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
28254FD11ED87FDC00683656 /* PlaylistsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28254FD01ED87FDC00683656 /* PlaylistsViewController.swift */; };
28254FD41ED8807D00683656 /* PlaylistTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28254FD21ED8807D00683656 /* PlaylistTableViewCell.swift */; };
28254FD51ED8807D00683656 /* PlaylistTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28254FD31ED8807D00683656 /* PlaylistTableViewCell.xib */; };
283E942121B697E900F02E6F /* CreateSubtitleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 283E942021B697E900F02E6F /* CreateSubtitleViewController.swift */; };
283E942A21B6D6F300F02E6F /* file.srt in Resources */ = {isa = PBXBuildFile; fileRef = 283E942921B6D6F200F02E6F /* file.srt */; };
286B000821B5484F00C34DBC /* PosterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286B000721B5484F00C34DBC /* PosterViewController.swift */; };
287676C21E64810400E675BE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 287676C11E64810400E675BE /* AppDelegate.swift */; };
287676C41E64810400E675BE /* VideosViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 287676C31E64810400E675BE /* VideosViewController.swift */; };
287676C71E64810400E675BE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 287676C51E64810400E675BE /* Main.storyboard */; };
Expand All @@ -30,6 +33,7 @@
2882AD2E1ED589B60088F7E4 /* VideoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882AD2C1ED589B60088F7E4 /* VideoTableViewCell.swift */; };
2882AD2F1ED589B60088F7E4 /* VideoTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2882AD2D1ED589B60088F7E4 /* VideoTableViewCell.xib */; };
2882AD341ED5CF9A0088F7E4 /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882AD331ED5CF990088F7E4 /* LoadingView.swift */; };
28995CD921B58DDB0057EAD6 /* SubtitlesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28995CD821B58DDB0057EAD6 /* SubtitlesViewController.swift */; };
28C2B4641E6978B400226606 /* Vzaar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28C2B4611E6977CC00226606 /* Vzaar.framework */; };
28C2B4651E6978B400226606 /* Vzaar.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 28C2B4611E6977CC00226606 /* Vzaar.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
28CCE4761E78459800798834 /* Podfile in Resources */ = {isa = PBXBuildFile; fileRef = 28CCE4751E78459800798834 /* Podfile */; };
Expand Down Expand Up @@ -89,6 +93,9 @@
28254FD01ED87FDC00683656 /* PlaylistsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlaylistsViewController.swift; sourceTree = "<group>"; };
28254FD21ED8807D00683656 /* PlaylistTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlaylistTableViewCell.swift; sourceTree = "<group>"; };
28254FD31ED8807D00683656 /* PlaylistTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PlaylistTableViewCell.xib; sourceTree = "<group>"; };
283E942021B697E900F02E6F /* CreateSubtitleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateSubtitleViewController.swift; sourceTree = "<group>"; };
283E942921B6D6F200F02E6F /* file.srt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = file.srt; sourceTree = "<group>"; };
286B000721B5484F00C34DBC /* PosterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PosterViewController.swift; sourceTree = "<group>"; };
287676BE1E64810400E675BE /* TestVzaar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestVzaar.app; sourceTree = BUILT_PRODUCTS_DIR; };
287676C11E64810400E675BE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
287676C31E64810400E675BE /* VideosViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideosViewController.swift; sourceTree = "<group>"; };
Expand All @@ -101,6 +108,7 @@
2882AD2C1ED589B60088F7E4 /* VideoTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoTableViewCell.swift; sourceTree = "<group>"; };
2882AD2D1ED589B60088F7E4 /* VideoTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VideoTableViewCell.xib; sourceTree = "<group>"; };
2882AD331ED5CF990088F7E4 /* LoadingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = "<group>"; };
28995CD821B58DDB0057EAD6 /* SubtitlesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubtitlesViewController.swift; sourceTree = "<group>"; };
28C2B4521E6977CC00226606 /* Vzaar.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = Vzaar.xcodeproj; sourceTree = "<group>"; };
28CCE4751E78459800798834 /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
3CC36D2BAC1FD3C9ED57D320 /* Pods_TestVzaar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestVzaar.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -157,6 +165,7 @@
287676B51E64810400E675BE = {
isa = PBXGroup;
children = (
283E942921B6D6F200F02E6F /* file.srt */,
28CCE4751E78459800798834 /* Podfile */,
28C2B4521E6977CC00226606 /* Vzaar.xcodeproj */,
287676C01E64810400E675BE /* TestVzaar */,
Expand Down Expand Up @@ -199,6 +208,9 @@
28254FC11ED8637100683656 /* EncodingPresetsViewController.swift */,
28254FD01ED87FDC00683656 /* PlaylistsViewController.swift */,
287E42721EDD64AE0007765F /* AddPlaylistViewController.swift */,
286B000721B5484F00C34DBC /* PosterViewController.swift */,
28995CD821B58DDB0057EAD6 /* SubtitlesViewController.swift */,
283E942021B697E900F02E6F /* CreateSubtitleViewController.swift */,
);
name = Controllers;
sourceTree = "<group>";
Expand Down Expand Up @@ -258,7 +270,7 @@
TargetAttributes = {
287676BD1E64810400E675BE = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 46QQZDC6KN;
DevelopmentTeam = CWGMHV7Z76;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -316,6 +328,7 @@
287676CC1E64810400E675BE /* Assets.xcassets in Resources */,
2882AD2F1ED589B60088F7E4 /* VideoTableViewCell.xib in Resources */,
28254FC61ED8643700683656 /* EncodingPresetTableViewCell.xib in Resources */,
283E942A21B6D6F300F02E6F /* file.srt in Resources */,
287676C71E64810400E675BE /* Main.storyboard in Resources */,
28CCE4761E78459800798834 /* Podfile in Resources */,
);
Expand Down Expand Up @@ -376,9 +389,12 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
283E942121B697E900F02E6F /* CreateSubtitleViewController.swift in Sources */,
28254FC21ED8637100683656 /* EncodingPresetsViewController.swift in Sources */,
286B000821B5484F00C34DBC /* PosterViewController.swift in Sources */,
28254FB71ED84F3000683656 /* IngestRecipesViewController.swift in Sources */,
287676C41E64810400E675BE /* VideosViewController.swift in Sources */,
28995CD921B58DDB0057EAD6 /* SubtitlesViewController.swift in Sources */,
28254FBB1ED851E400683656 /* IngestRecipeTableViewCell.swift in Sources */,
287676CA1E64810400E675BE /* TestVzaar.xcdatamodeld in Sources */,
287E42731EDD64AE0007765F /* AddPlaylistViewController.swift in Sources */,
Expand Down Expand Up @@ -525,7 +541,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 46QQZDC6KN;
DEVELOPMENT_TEAM = CWGMHV7Z76;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vzaar",
Expand All @@ -549,7 +565,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 46QQZDC6KN;
DEVELOPMENT_TEAM = CWGMHV7Z76;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vzaar",
Expand Down
8 changes: 8 additions & 0 deletions TestVzaar.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
11 changes: 10 additions & 1 deletion TestVzaar/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import CoreData
import Vzaar

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -28,22 +29,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

Vzaar.sharedInstance().suspendUploadTask()
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.




}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

Vzaar.sharedInstance().resumeUploadTask()
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
}

// MARK: - Core Data stack

lazy var persistentContainer: NSPersistentContainer = {
Expand Down
5 changes: 5 additions & 0 deletions TestVzaar/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
Loading

0 comments on commit 29cb75b

Please sign in to comment.