I’m trying to use Bitmovin on tvOS. It works in the tvOS simulator, but when I try to use it on an AppleTV device, playback doesn’t begin.
This is the code I’m using:
private var bmPlayer: Player!
func play(url: URL) {
let view = UIView()
view.frame = self.view.bounds
self.view .addSubview(view)
let config = PlayerConfig()
config.key = "<redacted>"
// Enable auto play
config.playbackConfig.isAutoplayEnabled = true
// Create player based on player configuration
bmPlayer = PlayerFactory.create(playerConfig: config)
// Create player view and pass the player instance to it
let playerView = PlayerView(player: bmPlayer, frame: .zero)
// Listen to player events
bmPlayer.add(listener: self)
playerView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
playerView.frame = view.bounds
view.addSubview(playerView)
view.bringSubviewToFront(playerView)
let sourceConfig = SourceConfig(url: url, type: .progressive)
bmPlayer.load(sourceConfig: sourceConfig)
}