You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Sunday, February 12th 2012, 11:33pm

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?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<plugin name="soundinterface" url="soundinterface.swf" alturl="soundinterface.js"
	     keep="true"
	     volume=".1"
	     onloaded="playsound(1,'%SWFPATH%/audio/music.mp3',0);" />	

<!-- PERSONAL TOUCH: Sound mute/resume button	-->
	<plugin name="bg-play" 
		url="soundoff.png"
		onloaded="set(alpha,0); tween(alpha,.8);"
		zorder="2"   
		origin="topleft" 
		edge="topleft" 
		y="25" x="25"
		visible="false"
		keep="true"
		onhover="showtext(Resume Music);"                     
		onclick="action(playsound)" />		   	
						   
   	<plugin name="bg-mute" 
		url="sound.png"
		onloaded="set(alpha,0); tween(alpha,.8);"
		zorder="2"   
		origin="topleft" 
		edge="topleft" 
		y="25" x="25"
		visible="true"
		keep="true"
		onhover="showtext(Pause Music);"                    
		onclick="action(mutesound)" />

	<action name="playsound">
		resumesound(1);
		set(plugin[bg-mute].visible,true);
		set(plugin[bg-play].visible,false);
		</action>
	<action name="mutesound">
		pausesound(1);
		set(plugin[bg-mute].visible,false);
		set(plugin[bg-play].visible,true);
		</action>


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

This post has been edited 1 times, last edit by "Tebasaki" (Feb 13th 2012, 1:09am)


2

Monday, February 13th 2012, 9:46am

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 ;-)

Best regards
Nupsi

3

Monday, February 13th 2012, 12:36pm

you can't pause sound on ipad,

read carrefully the doc about soundinterface.

regards

4

Monday, February 13th 2012, 3:08pm

you can't pause sound on ipad

That would be very strange, because I use the pause and resume-function with the soundinterface on ipad and iphone too and it works just fine ;-)

Best regards
Nupsi

5

Tuesday, February 14th 2012, 3:27am

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."

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
	<plugin name="soundinterface" url="soundinterface.swf" alturl="soundinterface.js"
	     keep="true"
	     volume=".1"
	     onloaded="playsound(1,'%SWFPATH%/audio/music.mp3',0);" />	

<!-- NICKS PERSONAL TOUCH: Sound mute/resume button	-->
	<plugin name="bg-play" 
		url="soundoff.png"
		onloaded="set(alpha,0.8);"
		zorder="2"   
		origin="topleft" 
		edge="topleft" 
		y="25" x="25"
		visible="false"
		keep="true"
		onhover="showtext(Resume Music);"                     
		onclick="action(playsound)" />		   	
						   
   	<plugin name="bg-mute" 
		url="sound.png"
		onloaded="set(alpha,0.8);"
		zorder="2"   
		origin="topleft" 
		edge="topleft" 
		y="25" x="25"
		visible="true"
		keep="true"
		onhover="showtext(Pause Music);"                    
		onclick="action(mutesound)" />

	<action name="playsound">
		
<!--	playsound(1,'%SWFPATH%/audio/music.mp3',0);	-->
		resumesound(1);
		set(plugin[bg-mute].visible,true);
		set(plugin[bg-play].visible,false);
		</action>
	<action name="mutesound">
		pausesound(1);
		set(plugin[bg-mute].visible,false);
		set(plugin[bg-play].visible,true);
		</action>

6

Tuesday, February 14th 2012, 8:59am

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

Sure, here we go:

Source code

1
2
3
<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

7

Saturday, February 18th 2012, 5:33pm

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.

This post has been edited 2 times, last edit by "Tebasaki" (Feb 19th 2012, 5:52am)


8

Sunday, February 19th 2012, 12:58pm


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

9

Sunday, February 19th 2012, 10:51pm

Works perfectly! Now I've got 2 more things to do and my site will be ready. haha

Thank you very much!

10

Monday, February 20th 2012, 9:29am

Thank you very much!

You´re welcome! Would like to see your page if it´s ready *smile*

Best regards
Nupsi

11

Monday, February 20th 2012, 9:39pm

I would be more than happy to show you what difficulties I'm running into now, haha.

Text clickable in a flyout, single xml with changable text

Once I get this figured out, I think I'll be ready for my "grand reveal."

Similar threads