Skip to content

Commit

Permalink
Add more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sukov committed Aug 19, 2024
1 parent 82f1bf6 commit 90368e2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/CachingPlayerItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public final class CachingPlayerItem: AVPlayerItem {

// MARK: Public init

/**
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.

- parameter url: URL referencing the media file.
*/
public convenience init(url: URL) {
self.init(url: url, saveFilePath: Self.randomFilePath(withExtension: url.pathExtension), customFileExtension: nil, avUrlAssetOptions: nil)
}
Expand Down Expand Up @@ -190,6 +195,12 @@ public final class CachingPlayerItem: AVPlayerItem {
addObservers()
}

/**
Play media using an AVAsset. Caching is **not** supported for this method.

- parameter asset: An instance of AVAsset.
- parameter automaticallyLoadedAssetKeys: An NSArray of NSStrings, each representing a property key defined by AVAsset.
*/
override public init(asset: AVAsset, automaticallyLoadedAssetKeys: [String]?) {
self.url = URL(fileURLWithPath: "")
self.initialScheme = nil
Expand Down

0 comments on commit 90368e2

Please sign in to comment.