/DotstudioPRO.swift

DotstudioPRO library for ios & tvos swift.

Primary LanguageSwiftMIT LicenseMIT

DotstudioPRO.swift

DotstudioPRO library for ios & tvos swift.

Requirements.

  • iOS 9+
  • Xcode 10.2.1
  • Swift 5.0

Install using CocoaPods

Add the following line to your Podfile:

pod ‘DotstudioPRO’, :git => ’https://github.com/dotstudiopro/DotstudioPRO.swift.git'

Installation Notes

  • If developing using Xcode 10 and targeting iOS devices running iOS 12 or higher, the "Access WiFi Information" capability is required in order to discover and connect to Cast devices.
  • You need to add Microphone usage permission.

Usage & Configuration

First import DotstudioPRO & Next in your AppDelegate.swift add the following:

import DotstudioPRO
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  DSPRO.initializeWith(config: [“apikey”:<api-key>], completion: { (bInitialized) in
       // code when initialization is done.
       
   }) { (error) in
       // code to handle error.
   }
...
}

Configuration Parameters

  • apikey : Pass Company Api Key

Create iOS Player

if let dspPlayerViewController = DSPPlayerViewController.getViewController() {
    dspPlayerViewController.view.frame = self.playerContainerView.bounds
    self.playerContainerView.addSubview(dspPlayerViewController.view)
    let dspVideo = DSPVideo()
    dspVideo.strId = "<video-id>"
    dspPlayerViewController.setCurrentVideo(curVideo: dspVideo)
}

Create tvOS Player

if let dspPlayerViewController = DSPPlayerViewController.getViewController() {
    let dspVideo = DSPVideo()
    dspVideo.strId = "<video-id>"
    dspPlayerViewController.setCurrentVideo(curVideo: dspVideo)
    self.present(dspPlayerViewController, animated: true, completion: nil)
}