AudioPlayer
open class AudioPlayer : NSObject, @unchecked Sendable
音频播放器
-
Undocumented
Declaration
Swift
public static let shared: AudioPlayer
-
Undocumented
Declaration
Swift
open weak var delegate: AudioPlayerDelegate?
-
Undocumented
Declaration
Swift
open weak var dataSource: AudioPlayerDataSource?
-
Undocumented
Declaration
Swift
open var itemsCount: Int
-
Undocumented
Declaration
Swift
open var itemURLs: [Any]?
-
Undocumented
Declaration
Swift
open var disableLogs: Bool
-
Undocumented
Declaration
Swift
@MainActor open var audioPlayer: AVQueuePlayer { get }
-
Undocumented
Declaration
Swift
open private(set) var playerItems: [AVPlayerItem]? { get }
-
Undocumented
Declaration
Swift
@MainActor open var repeatMode: AudioPlayerRepeatMode
-
Undocumented
Declaration
Swift
@MainActor open var shuffleMode: AudioPlayerShuffleMode { get set }
-
Undocumented
Declaration
Swift
open var isMemoryCached: Bool { get set }
-
Undocumented
Declaration
Swift
@MainActor open var isPlaying: Bool { get }
-
Undocumented
Declaration
Swift
open private(set) var lastItemIndex: Int { get }
-
Undocumented
Declaration
Swift
@MainActor open var currentItem: AVPlayerItem? { get }
-
Undocumented
Declaration
Swift
@MainActor open var playerStatus: AudioPlayerStatus { get }
-
Undocumented
Declaration
Swift
@MainActor open var playingItemCurrentTime: Float { get }
-
Undocumented
Declaration
Swift
@MainActor open var playingItemDurationTime: Float { get }
-
Undocumented
Declaration
Swift
open var observePeriodicTime: Bool { get set }
-
Undocumented
Declaration
Swift
override public init()
-
Undocumented
Declaration
Swift
open func setupPlayerItem(url: Any, index: Int)
-
Undocumented
Declaration
Swift
@MainActor open func playItem(from startIndex: Int)
-
Undocumented
Declaration
Swift
open func removeAllItems()
-
Undocumented
Declaration
Swift
open func removeQueueItems()
-
Undocumented
Declaration
Swift
open func getAudioIndex(_ item: AVPlayerItem?) -> Int?
-
Undocumented
Declaration
Swift
open func removeItem(at index: Int)
-
Undocumented
Declaration
Swift
@MainActor open func moveItem(from: Int, to: Int)
-
Undocumented
Declaration
Swift
@MainActor open func play()
-
Undocumented
Declaration
Swift
@MainActor open func pause()
-
Undocumented
Declaration
Swift
@MainActor open func playPrevious()
-
Undocumented
Declaration
Swift
@MainActor open func playNext()
-
Undocumented
Declaration
Swift
@MainActor open func seek(to seconds: Double, completionHandler: (@Sendable (Bool) -> Void)? = nil)
-
Undocumented
Declaration
Swift
@MainActor open func addBoundaryTimeObserver(for times: [NSValue], queue: DispatchQueue?, using block: @escaping @Sendable () -> Void) -> Any
-
Undocumented
Declaration
Swift
@MainActor open func addPeriodicTimeObserver(for interval: CMTime, queue: DispatchQueue?, using block: @escaping @Sendable (CMTime) -> Void) -> Any
-
Undocumented
Declaration
Swift
open func removeTimeObserver(_ observer: Any)
-
Undocumented
Declaration
Swift
open func destroyPlayer()
-
Undocumented
Declaration
Swift
override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?)