AudioPlayerView
struct AudioPlayerView : View
SwiftUI View
for the audio player
-
The music URL
Declaration
Swift
let musicURL: URL
-
The
AVAudioPlayer
Declaration
Swift
@State private var audioPlayer: AVAudioPlayer? { get nonmutating set }
-
Bool if the player is playing or not
Declaration
Swift
@State private var isPlaying: Bool { get nonmutating set }
-
The FileBrowser model
Declaration
Swift
@EnvironmentObject var fileBrowser: FileBrowser { get }
-
The status of the song
Declaration
Swift
@State private var status: Status { get nonmutating set }
-
The iCloud URL of the song
Declaration
Swift
private var iCloudURL: URL { get }
-
Show an
Alert
if the music file is not foundDeclaration
Swift
@State private var errorAlert: AlertMessage? { get nonmutating set }
-
Show an
ConfirmationDialog
if the music file is not downloadedDeclaration
Swift
@State private var confirmationDialog: AlertMessage? { get nonmutating set }
-
The body of the
View
Declaration
Swift
var body: some View { get }
-
The play button
Declaration
Swift
@ViewBuilder var playButton: some View { get }
-
The pause button
Declaration
Swift
@ViewBuilder var pauseButton: some View { get }
-
checkSong()
AsynchronousCheck the song file
Declaration
Swift
@MainActor private func checkSong() async
-
Play the song file
Declaration
Swift
private func playSong()
-
downloadSong()
AsynchronousDownload the song
Declaration
Swift
private func downloadSong() async