Hi Bitmovin,
I am experiencing a crash on iOS 16. When a url is not playing and we got error and user remains on the same screen and taps on play and pause button it cause a crash saying
BitmovinPlayer/DefaultSeekingService.swift:233: Fatal error: Current source cannot be nil.
guard !streamingUrl.isEmpty, let streamUrl = URL(string: streamingUrl.removingPercentEncoding ?? "") else {
return
}
let config = PlayerConfig()
config.styleConfig.userInterfaceType = .system
config.playbackConfig.isAutoplayEnabled = true
config.playbackConfig.isPictureInPictureEnabled = true
config.playbackConfig.isBackgroundPlaybackEnabled = true
config.tweaksConfig.isCustomHlsLoadingEnabled = false
config.tweaksConfig.isNativeHlsParsingEnabled = true
let player = PlayerFactory.create(playerConfig: config)
let playerView = PlayerView(player: player, frame: .zero)
playerView.fullscreenHandler = self
player.add(listener: self)
playerView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
playerView.frame = view.bounds
view.addSubview(playerView)
view.bringSubviewToFront(playerView)
self.playerView = playerView
self.player = player
// Bitmovin Analytics Configuration on intialization
if let title = appointmentTitle,
let apptId = appointmentId,
let deviceUUID = CNUserDefaultManger.shared.object(forKey: UserDefaultConstant.deviceUUID.rawValue) as? String,
let customUserId = MyProfileRepository.getMyProfile()?.basicProfile?.integrationId {
analyticsConfig = BitmovinAnalyticsConfig(key: "myKey")
analyticsConfig?.customData1 = deviceUUID
analyticsConfig?.customData2 = String(apptId)
analyticsConfig?.customData3 = defaultConfCode
analyticsConfig?.customerUserId = customUserId
analyticsConfig?.videoId = streamingUrl.removingPercentEncoding
analyticsConfig?.title = title
if let config = analyticsConfig {
analyticsCollector = BitmovinPlayerCollector(config: config)
}
}
let sourceConfig = SourceConfig(url: streamUrl, type: .hls)
let source = SourceFactory.create(from: sourceConfig)
source.add(listener: self)
self.player?.load(source: source)
It’s working fine on iOS 15 but on on 16 both iPhone as well iPad we are experiencing this issue.