TraceVisionSDK
Process video to generate personal highlights
Overview
Note
Currently the TraceVisionSDK only supports filming soccer ⚽️ - more sports coming soon! 🏀🏐There are 3 ways to use the TraceVisionSDK
Record video in real-time using
createVideoRecordSession(exportFullVideo:)
Process video from camera roll using
createVideoImportSession(needVideoResults:)
Process video frame-by-frame using your own custom video handling
createVideoByFramesSession(isSynchronous:)
Get the SDK and API keys
To start with the app you’ll need the TraceVision SDK binary framework and a pair of keys to initialize it. You can download the framework and find your keys in the developer portal
Adding the SDK
- Download the binary framework from the developer portal
- Unpack TraceVision SDK framework
- Drag and drop it into your project
Initializing the SDK
Before you start doing any processing with the SDK you need to initialize the SDK with your API token and secret that you got from TraceVision by calling initSDK(token:secret:)
called on the shared
instance of the SDK.
Initialization is asynchronous and can take some time to complete after the initSDK(token:secret:)
is finished.
Observe isSDKInited
to know when you can start using the SDK.
Note
You should initialize the SDK exactly once per app execution, so the good place to do it is inAppDelegate
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// Initialize TraceVision SDK with your token and secret
// This should be done only once when the app is launched
TraceVision.shared.initSDK(token: "YOUR_VISION_TOKEN", secret: "YOUR_VISION_SECRET")
TraceVision.shared.$isSDKInited.sink { inited in
if inited == true {
print("SDK is ready")
}
}.store(in: &cancellables)
}
}