DotstudioPRO library for ios & tvos swift.
- iOS 9+
- Xcode 10.2.1
- Swift 5.0
Add the following line to your Podfile:
pod ‘DotstudioPRO’, :git => ’https://github.com/dotstudiopro/DotstudioPRO.swift.git'
- 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.
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.
}
...
}
- apikey : Pass Company Api Key
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)
}
if let dspPlayerViewController = DSPPlayerViewController.getViewController() {
let dspVideo = DSPVideo()
dspVideo.strId = "<video-id>"
dspPlayerViewController.setCurrentVideo(curVideo: dspVideo)
self.present(dspPlayerViewController, animated: true, completion: nil)
}