Cant get subtitles to show in version 3.1.5
Hello,
I would like to add a .srt subtitles to my video, but subtitles wont show up.
Here is the code that I wrote inside of viewDidAppear
guard let filePath = filePath else {return}
player = VLCMediaPlayer()
player.drawable = playerView
media = VLCMedia(path: filePath)
player.media = media
player.delegate = self
guard let subtitlePath = Bundle.main.url(forResource: nil, withExtension: "srt") else {return}
player.play()
player.addPlaybackSlave(subtitlePath, type: .subtitle, enforce: true)
The user interface has ben setup in storyboard. There I have a custom NSView and it's class set to VLCVideoView. Than, I set all four constraints to pin to the all edges (top, bottom, leading and trailing).
Currently I am able to play a video, but subtitles are missing.
I tried the depricated method "openSubtitles" but the same thing happens.
Thanks in advance!