Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Using iOS audio controls to control the audio in Unity

Discussion in 'iOS and tvOS' started by kth, Jan 11, 2018.

  1. kth

    kth

    Joined:
    Mar 20, 2013
    Posts:
    3
    I'm trying to control the audio playing in unity using the built in controls of iOS.

    I've managed to get the audio playing when the app is running in the background and have made the controls visible using MPRemoteComandCenter.

    the problem I have is that the play button is always disabled and I can't change the info of the audio that is currently playing.

    I've tried this command to enable the play button but it doesn't work

    Code (CSharp):
    1.  [MPRemoteCommandCenter sharedCommandCenter].playCommand.enabled = YES
    I'm able to enable and disable the previous and next buttons but the play button is always disabled.

    IMG_0001.PNG

    also I'm using MPNowPlayingInfoCenter to set the info of the current audio but that doesn't work either.

    I would really appreciate some help on this, I've been trying to get it working for a couple of weeks with no luck.
     
    kurotsmile likes this.
  2. MohHeader

    MohHeader

    Joined:
    Aug 12, 2015
    Posts:
    41
    Hi,,
    I know it is super old ( 1 year ) but just thought to ask if you were able to reach somewhere :)