Skip to content

Commit 90368e2

Browse files
committed
Add more documentation
1 parent 82f1bf6 commit 90368e2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Source/CachingPlayerItem.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public final class CachingPlayerItem: AVPlayerItem {
5151

5252
// MARK: Public init
5353

54+
/**
55+
Play and cache remote media on a local file. `saveFilePath` is **randomly** generated. Requires `url.pathExtension` to not be empty otherwise the player will fail playing.
56+
57+
- parameter url: URL referencing the media file.
58+
*/
5459
public convenience init(url: URL) {
5560
self.init(url: url, saveFilePath: Self.randomFilePath(withExtension: url.pathExtension), customFileExtension: nil, avUrlAssetOptions: nil)
5661
}
@@ -190,6 +195,12 @@ public final class CachingPlayerItem: AVPlayerItem {
190195
addObservers()
191196
}
192197

198+
/**
199+
Play media using an AVAsset. Caching is **not** supported for this method.
200+
201+
- parameter asset: An instance of AVAsset.
202+
- parameter automaticallyLoadedAssetKeys: An NSArray of NSStrings, each representing a property key defined by AVAsset.
203+
*/
193204
override public init(asset: AVAsset, automaticallyLoadedAssetKeys: [String]?) {
194205
self.url = URL(fileURLWithPath: "")
195206
self.initialScheme = nil

0 commit comments

Comments
 (0)