Skip to content

Commit e167be8

Browse files
hungnguyen1791nguyentanhungbksukov
authored
Fix crash when playing with AVPlayerLooper (#9)
* fix crash * Update Source/CachingPlayerItem.swift Co-authored-by: Gorjan Shukov <gorjan.shukov@gmail.com> --------- Co-authored-by: HungNguyen <tanhung0107@gmail.com> Co-authored-by: Gorjan Shukov <gorjan.shukov@gmail.com>
1 parent 9ac9d56 commit e167be8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Source/CachingPlayerItem.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,13 @@ public final class CachingPlayerItem: AVPlayerItem {
190190
addObservers()
191191
}
192192

193-
/// Not implemented
194193
override public init(asset: AVAsset, automaticallyLoadedAssetKeys: [String]?) {
195-
fatalError("CachingPlayerItem error: init(asset:automaticallyLoadedAssetKeys:) not implemented")
194+
self.url = URL(fileURLWithPath: "")
195+
self.initialScheme = nil
196+
self.saveFilePath = ""
197+
super.init(asset: asset, automaticallyLoadedAssetKeys: automaticallyLoadedAssetKeys)
198+
199+
addObservers()
196200
}
197201

198202
deinit {

0 commit comments

Comments
 (0)