# 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 | Default | Description |
|---|---|---|---|
init(licenseKey:) | String | required | License key for the SDK |
.item(_:) | ByteArkPlayerItem | - | The video to play (use this or .playlist(_:)) |
.playlist(_:) | ByteArkPlayerPlaylist | - | A playlist to play (use this or .item(_:)) |
.autoplay(_:) | Bool | false | Start playback automatically once ready |
.muted(_:) | Bool | false | Start playback muted |
.controls(enabled:) | Bool | true | Show the built-in control bar |
.customControls(with:) | UIView | - | Use a custom controls view instead of the built-in one |
.pictureInPicture(enabled:) | Bool | true | Enable Picture-in-Picture |
.seekButtons(enabled:time:) | Bool, TimeInterval | true, 10 | Show seek-forward/backward buttons and double-tap-to-seek; time is the step in seconds |
.fullscreenMode(_:) | ByteArkPlayerFullscreenMode | .rotate | How fullscreen is presented (see Fullscreen) |
.rotateToFullscreen(_:) | Bool | false | Enter fullscreen automatically when the device is rotated to landscape |
.dvr(enabled:) | Bool | false | Enable DVR (seek back within the live window) for live streams (see DVR) |
.remoteControlCenter(enabled:) | Bool | false | Enable control from iOS Control Center (see Remote Control) |
.backgroundAudio(enabled:) | Bool | false | Keep audio playing while the app is backgrounded (see Background Audio) |
.backButton(enabled:action:) | Bool, closure | false | Show a back button and handle its tap |
.playbackSpeeds(_:) | [Float] | [] | Playback-speed options the viewer can pick (see Playback Speed) |
.playbackMode(_:) | ByteArkPlayerPlaybackMode | .disable | Repeat behavior: .disable, .loop, .repeat |
.language(_:) | ByteArkPlayerLanguage | .english | UI language for the player's built-in controls (see Language and UI Text) |
.customSubtitle(_:) | Bool | false | Render subtitles in the SDK's own overlay (see Subtitle) |
.subtitleSize(_:) | ByteArkPlayerSubtitleSize | .medium | Subtitle text size (see Subtitle) |
.subtitlePaddingBottomPercentage(_:) | Int | 10 | Lift subtitles from the bottom edge, as a percentage of video-frame height (see Subtitle) |
.secureSurface(_:) | Bool | false | Prevent screen capture of DRM content |
.playlistButton(enabled:) | Bool | true | Show the playlist (next/previous) buttons |
.playbackEngine(_:) | ByteArkPlayerPlaybackEngine | default | 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.