DASH Playback is supported by our player engine with some key differences.
- based on
asl
- custom player engine, and otherAVFoundation
andVideoToolbox
frameworks classes - support for Widevine
- advanced tuning settings and customization
Dash
Dash playback is supported by our custom VTPlayer
player which leverages the native VideoToolbox
framework. On top of that we have implemented a native manifest parser, samples downloader and ABR algorithms.
CastlabsWidevine
adds support for the Widevine
CDM.
ABR Settings
Adaptive Bitrate Controls
NOTE: This document does not apply to the iOS native apple player aka AVPlayer. Only the castlabs player supports these functions.
When using the castLabs player there are some additional APIs available to help control how the bitrate/quality is selected during playback. The process for using them is as follows:
Steps to configure Abr Settings
If needed, enable DASH playback support by ensuring the VTPlugin
is registered with the SDK, e.g.
import CastlabsVT
let res = PRESTOPlaySDK.shared.register("licence", [VTPlugin()], "userId")
Before creating the player, ensure it will be the castlabs player and not the apple player. (NOTE: DASH content will always be played by the castlabs player regardless of this setting)
let playerConfiguration = PlayerConfiguration(with: streamUrl, contentType: .dash)
playerConfiguration.preferredEngine = .castlabs
Configure the bitrate adaptation settings (BEFORE playing the content)
var abrConfiguration = AbrConfiguration()
abrConfiguration.maxInitialBitrate = 1_000_000
abrConfiguration.minDurationForQualityIncreaseMs = 6_000
playerConfiguration.abrConfiguration = abrConfiguration
let player = PRESTOPlaySDK.shared.player(for: playerConfiguration)
Please see AbrConfiguration.swift for details of all the parameters available.
Buffer Settings
let player = PRESTOPlaySDK.shared.player(for: playerConfiguration)
player.minPrebufferTime = 6.0
player.maxPrebufferTime = 60.0
player.minRebufferTime = 12.0
Demo
Please find an example of ABR customization in examples/CastlabsDASHDemo
.