Can't resume the music on iPad

  • I'm trying to get my buttons to work on iPads and iPhones. Here's the code of my buttons. On the iPad, pausing the music is no problem, but I can't get it to resume. What am I not including?

    Even when I change the resumesound (1) with playsound(1,'%SWFPATH%/audio/music.mp3',0); it still doesn't play.

    Einmal editiert, zuletzt von Tebasaki (13. Februar 2012 um 01:09)

  • Hi Tebaski,

    from my pov everything looks fine, except that you did´nt set any time for the tweens. And I´m not sure if setting values like this ".8" instead of "0.8" is correct or could result in strange behavior. And did you try to set a different name for the sound or set it to "auto"? I mean "1" should work fine, but krpano still have some issues when it comes to little details *wink*

    Best regards
    Nupsi

  • Nupsi, could you share a snippet of your code for me to test with? I tried the 0.8, as you said, I don't really care about the tweening right now as long as it works (it didn't work with it), so I even went so far as to remove it and it still has the same results.
    Changing the name from "1" to "auto" makes the buttons not work! Any other word seems to work except "auto."

  • Nupsi, could you share a snippet of your code for me to test with?


    Sure, here we go:

    Code
    <action name="mute" >
    if(sound == 1, pausesound(music);set(sound,0),resumesound(music);set(sound,1));
    </action>

    And like I said, it works like a charm *smile* Oh...and make sure you´re using the latest krpano-version including the latest version of soundinterface!

    Best regards
    Nupsi

  • Could you break down the syntax?
    What is sound == 1?
    if the sound is 1, then pause the music, set the sound to 0
    else resume the music and set sound to 1?

    I'm trying to figure out where to put in my
    set(plugin[mute].visible,false);
    set(plugin[play].visible,true);
    and
    set(plugin[mute].visible,true);
    set(plugin[play].visible,false);

    To allow for the image to swap when it's muted and playing.
    I got
    if(sound == 0, resumesound(music);set(sound,1),set(plugin[mute].visible,false);set(plugin[play].visible,true);
    pausesound(music);set(sound,0)
    );
    I flipped it so it would pause after the sound auto loaded/played, and this makes the image swap, but I can't make it swap back, although the button still works.

    2 Mal editiert, zuletzt von Tebasaki (19. Februar 2012 um 05:52)


  • What is sound == 1?
    if the sound is 1, then pause the music, set the sound to 0
    else resume the music and set sound to 1?


    Yep, that' s correct!

    You got a little error in your code. Your code should look like this:

    if(sound == 0, resumesound(music);set(sound,1);set(plugin[mute].visible,false);set(plugin[play].visible,true),pausesound(music);set(sound,0);set(plugin[play].visible,false);set(plugin[mute].visible,true);
    );

    That should work.

    Best regards
    Nupsi

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!