- Create a Podfile if you don't already have one. From the root of your project directory, run the following command:
THEOliveSDKas a dependency in your Podfile:
pod 'THEOliveSDK', '1.0.0'
- Install the pods using
pod install, then open your
.xcworkspacefile to see the project in Xcode.
Import the SDK
let player = THEOlivePlayer()
Create a view controller for the player using
let playerViewController = THEOlivePlayerViewController(player: player)
Then embed this view controller in one of your own view controllers
let yourViewController = UIViewController(nibName: nil, bundle: nil) yourViewController.addChild(playerViewController) yourViewController.view.addSubview(playerViewController.view) playerViewController.didMove(toParent: yourViewController)
To control the player use the
player property of the
THEOlivePlayerViewController. For more information of the player API see you can download the API documentation here: THEOliveSDK-1.0.0.doccarchive.zip
For sample Xcode projects see https://github.com/theoplayer/theolive-ios-samples.
Updated about 2 months ago