EXC_BAD_ACCESS (code=1, address=0xf00000020) in HandleMediaDurationChanged
I am trying to create an audio player using SwiftUI and VLCKit. I installed VLCKit 4.0.0a2
(to fix a bug that mutes audio for 1s after resuming) using CocoaPods. I added a Bridging Header and stream m4a audio from an URL like this:
self.vlcPlayer = VLCMediaPlayer()
[...]
let streamUrl = try await source.fetchStreamUrl(track: track)
self.vlcPlayer.media = VLCMedia(url: streamUrl)
try AVAudioSession.sharedInstance().setActive(true)
self.vlcPlayer.play()
After executing the second half of the snippet, my app crashed with EXC_BAD_ACCESS (code=1, address=0xf00000020) in HandleMediaDurationChanged.
Here are my other relevant files for this issue:
Nyx-Bridging-Header.h:
#import "MobileVLCKit/MobileVLCKit.h"
Podfile
source 'https://cdn.cocoapods.org/'
target 'Nyx' do
use_frameworks!
platform :ios, '17.0'
pod 'MobileVLCKit', '~>4.0.0a2'
end
Please let me know if you need any additional information about this issue.