loading...
api.video

api.video Launches iOS SDK

dougsillars profile image Doug Sillars Originally published at Medium on ・2 min read

iPhone development image https://www.flickr.com/photos/ramotion/5189385602

api.video removes the complexity from streaming video. Our simple to use APIs allow you to focus on creating your content, and leaving the video streaming details to us.

Since launching api.video, one of the most common questions we are asked is “do you have mobile SDKs?” Today, we can answer that with a “yes!”

Late last year, we announced our Android SDK, and today we are happy to announce the release of our iOS SDK. If you have used api.video in the past, you’ll see that all of the features that are available in our APIs are now available as native iOS calls.

If you have never used api.video, imagine a simple API interface to upload, modify, and delete video streams, create custom players, add captions or chapters, and even live stream video — all from the native app. That is the power that api.video (and all of our SDKs) can give you. To get started, read the documentation on GitHub, and check out the demo application code(launching this week).

The quick start guide (pulled from GitHub):

Installation

Cocoapod

  1. Add the following entry to your Podfile:

pod ‘sdkApiVideo’

  1. Then run pod install

  2. Don’t forget to import sdkApiVideo in every file you’d like to use api.video sdk

Quick Start

1. In the AppDelegate.swift instantiate a new Client

let authClient = Client()

2. In the didFinishLaunchingWithOptions func add the following code

  • If you want to use the production environment, use createProduction method
  • If you want to use the sandbox environment , use createSandbox method

authClient.createSandbox(key: « YOUR_SANDBOX_API_KEY »){ (created, reponse) in

}

3. In your ViewController.swift file import the sdk

import sdkApiVideo

4. Create Variable

let appDelegate = UIApplication.shared.delegate as! AppDelegate

5. In viewDidLoad func

self.videoApi = appDelegate.authClient.videoApi

6. Create and upload a video file

self.videoApi.create(title: «title», description: «description», fileName: «filename», filePath: «filePath», url: «url»){ (uploaded, resp) in

if(resp != nil){

print(“error : ((resp?.statusCode)!) -> ((resp?.message)!)”)

}else{

if(uploaded){

//Do whatever you want

}else{

// Do whatever you want

}

}

}

And that’s all there is to it!

Now you can use all your favourite api.video calls in your mobile app, simplifying the delivery of your videos with one API to apps, browsers and billions of devices around the world.

If you have questions, file an issue, or reach out to us on chat.

Posted on Feb 17 by:

dougsillars profile

Doug Sillars

@dougsillars

Doug is is a freelance mobile performance expert and developer advocate. He's a Google Developer Expert and the author of O’Reilly’s “High Performance Android Apps." Available for consultations.

api.video

We erase the pains of online video workflows with our cloud-native & API-first platform.

Discussion

markdown guide