Closed 666bsw closed 8 months ago
You can look to add this functionality if you want, currently playing items this way is not supported.
@666bsw you can add this extension to play a sound file from your local:
extension AudioPlayer {
func playFile(fileName: String) {
let soundFileComponents = fileName.trimmingCharacters(in: .whitespacesAndNewlines).components(separatedBy: ".")
guard soundFileComponents.count == 2 else {
return
}
guard let url = Bundle.main.url(forResource: soundFileComponents[0], withExtension: soundFileComponents[1]) else {
return
}
play(url: url)
}
}
Hello!
how to play files MPMediaItem witch assetURL ? for example: assetURL = Optional(ipod-library://item/item.m4a?id=6247563662587856568)
the framework tries to look for something on the network. the file is not played.