VLCMediaPlayer.startRecording(atPath:) not working
Environment
Xcode 11.3.1
MobileVLCKit (3.3.0) installed with CocoaPods
I cannot make startRecording
work. here is how i tried to use it :
let mediaURL = "https://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4"
var mediaPlayer = VLCMediaPlayer()
mediaPlayer.libraryInstance.debugLogging = true
let media = VLCMedia(url: URL(string: mediaURL)!)
mediaPlayer.media = media
let path = ...some path...
let res = mediaPlayer.startRecording(atPath: path)
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0, execute: { [weak self] in
let res = self?.mediaPlayer.stopRecording()
})
both startRecording
and stopRecording
return true but there is no file to be found.
According to the comments above the declaration of startRecording
the path should point to a directory.
In place of path, I have provided FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.path
Other paths i've tried :
- i tried with
absoluteString
instead ofpath
- i tried with appending the filename to the path
Also: Debug logs do not prompt anything
Also: I do not understand why startRecording()
returns false
if i call play()
before it.