Skip to content

Not working #240

@sam961

Description

@sam961

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions