Swift

Getting Started

  1. In the target’s General tab, in the Embedded Binaries click (+) and select the THEOplayerSDK.framework
  2. import THEOplayerSDK in your view controller
  3. Declare a player variable
var player = THEOplayer()
  1. Position and size your player
player.frame = CGRect(x: 0, y: 0, width: 320, height: 180)
  1. 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