fix: memory deallocation (iOS)

This commit is contained in:
Brian Sztamfater 2023-05-06 16:42:45 -03:00
parent 1e9199bb36
commit 9a9241b9c9
1 changed files with 7 additions and 0 deletions

View File

@ -58,6 +58,13 @@ class TransparentVideoView : UIView {
loadItem(url: itemUrl)
}
deinit {
playerView?.player?.pause()
playerView?.player?.replaceCurrentItem(with: nil)
playerView?.removeFromSuperview()
playerView = nil
}
// MARK: - Player Item Configuration
private func loadItem(url: URL) {