Skip to content

Commit 72e3a88

Browse files
committed
setting options when preloading
making preloadNext public
1 parent 06d881f commit 72e3a88

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

SwiftAudioEx/Classes/AVPlayerWrapper/AVPlayerWrapper.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ extension AVPlayerWrapper: AVPlayerObserverDelegate {
356356
let urlString = item.getSourceUrl();
357357
let url = URL(string: urlString);
358358

359-
let asset = AVURLAsset(url:url!);
359+
let options = (item as? AssetOptionsProviding)?.getAssetOptions()
360+
let asset = AVURLAsset(url:url!, options: options)
360361
let keys = ["playable", "tracks", "duration"];
361362

362363
asset.loadValuesAsynchronously(forKeys: keys, completionHandler: {

SwiftAudioEx/Classes/QueuedAudioPlayer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public class QueuedAudioPlayer: AudioPlayer, QueueManagerDelegate {
232232
self.event.queueIndex.emit(data: (nil, 0))
233233
}
234234

235-
func preloadNext() {
235+
public func preloadNext() {
236236
let nextItems = queueManager.nextItems
237237

238238
if nextItems.count > 0 {

0 commit comments

Comments
 (0)