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 observable
FileBrowser
classDeclaration
Swift
@Environment private var fileBrowser: FileBrowser { get }
-
The status of the song
Declaration
Swift
@State private var status: ChordProviderError { 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 }
-
Bool to show the folder selector
Declaration
Swift
@State private var showFolderSelector: Bool { 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 }
-
Check the song file
Declaration
Swift
private static func checkSong(musicURL: URL, iCloudURL: URL) -> ChordProviderError
-
Play the song file
Declaration
Swift
private func playSong()
-
Download the song
Declaration
Swift
private func downloadSong(musicURL: URL, iCloudURL: URL)