Player icon indicating copy to clipboard operation
Player copied to clipboard

Not working

Open sam961 opened this issue 4 years ago • 0 comments

Hello, I added the following code in the viewDidLoad

    override func viewDidLoad() {
        super.viewDidLoad()
    
        self.player.playerDelegate = self
        self.player.playbackDelegate = self
        self.player.url = URL(string: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-15.mp3")!
        self.player.playbackResumesWhenBecameActive=false

    }

and added IBaction to play the audio using the below

    @IBAction func playButtonPressed(_ sender: UIButton) {

       // print(self.player.view)
        self.player.playFromBeginning()
    }

But unfortunatley , this is not working until I add the code below

print(self.player.view)

This will load the Player class into memory and it will unlock the isViewLoaded

How can this be fixed and the audio don't play automatically unless the user click in Play Button

sam961 avatar Mar 29 '21 20:03 sam961