Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working #240

Open
sam961 opened this issue Mar 29, 2021 · 0 comments
Open

Not working #240

sam961 opened this issue Mar 29, 2021 · 0 comments

Comments

@sam961
Copy link

sam961 commented Mar 29, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant