# Options
The player is configured through two builders: ByteArkPlayerConfigBuilder for player-wide settings and ByteArkPlayerItemBuilder for the video to be played.
# ByteArkPlayerConfigBuilder
let config = try ByteArkPlayerConfigBuilder(licenseKey: "<YOUR_LICENSE_KEY>")
.item(item)
.autoplay(true)
.build()
1
2
3
4
2
3
4
| Builder method | Type | Description |
|---|---|---|
init(licenseKey:) | String | License key for the SDK |
.item(_:) | ByteArkPlayerItem | The video to play |
.autoplay(_:) | Bool | Start playback automatically once ready |
.playbackEngine(_:) | ByteArkPlayerPlaybackEngine | Custom playback engine (see Playback Engine) |
.addPlugin(plugin:, name:) | ByteArkPlayerPlugin, String | Attach a plugin to the player |
# ByteArkPlayerItemBuilder
let item = try ByteArkPlayerItemBuilder()
.media(URL(string: "<MEDIA_URL>")!)
.title("Big Buck Bunny")
.build()
1
2
3
4
2
3
4
| Builder method | Type | Required | Description |
|---|---|---|---|
.media(_:) | URL | Yes | Video URL (HLS .m3u8 or progressive) |
.title(_:) | String | No | Video title (required when using Lighthouse) |
.drmDataSource(_:) | ByteArkPlayerDrmDataSource | No | DRM data source for FairPlay (see Apple FairPlay) |
# Plugin config builders
Each plugin has its own config builder:
| Plugin | Config builder | Guide |
|---|---|---|
| Ads | ByteArkPlayerAdsConfigBuilder(adsTagUrl:) | Advertisement |
| AirPlay | ByteArkPlayerAirplayConfigBuilder() | Apple AirPlay |
| Lighthouse | ByteArkPlayerLighthouseConfigBuilder(projectId:) | ByteArk Lighthouse |
| Nielsen | ByteArkPlayerNielsenConfigBuilder(...) | Nielsen DCR |
See the individual plugin pages for the detailed configuration of each.