I have a struct CustomContainer
which I need to save to fileManager. The Problem is that struct contains AVPlayer
& AVPlayerItem
and I can’t figure out how to handle those. The structure of the code is in such a way that I can’t keep these AV
items out of the struct. I am able to cache them but can’t seem to save them in fileManager.
class CustomContainer {
var url: String
var reset: Bool = false {
didSet {
if reset {
player.pause()
player.seek(to: .zero)
}
}
}
let player: AVPlayer
let playerItem: AVPlayerItem
init(player: AVPlayer, item: AVPlayerItem, url: String) {
self.player = player
self.playerItem = item
self.url = url
}
}
Any help would be appreciated!