Swift
Getting Started
- In the target’s General tab, in the Embedded Binaries click (+) and select the THEOplayerSDK.framework
import THEOplayerSDK
in your view controller- Declare a player variable
var player = THEOplayer()
- Position and size your player
player.frame = CGRect(x: 0, y: 0, width: 320, height: 180)
- Add the player to your controller’s view hierarchy
player.addAsSubview(of: controller.view)
Set a Media Source
Create a SourceDescription object and set the player’s source
let source = SourceDescription(sources: TypedSource(src: "https://www.examples.com/index.m3u8", type: "application/x-mpegurl"))
player.source = source