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

Friday, March 23rd 2018, 2:13pm

Sound does not stop with onremovepano stopsound

I'm playing a video using the video plugin without sound to be able to directly play the video in iOS. For the sound I'm using the soundinterface plugin.

The problem is the sound does not stop when I'm calling removepano('pano') and using in the XML file:

Source code

1
<events name="currentpano" onnewpano="playsound(bgsnd, 'assets/sound.mp3', 0);" onremovepano="stopsound(bgsnd);"/>


The full xml file content:

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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<krpano>

<plugin name="gyro" devices="html5"
url="plugins/gyro2.js"
enabled="true"
camroll="true"
friction="0.0"
touch_mode="full"
sensor_mode="1"
softstart="0.5"
autocalibration="false"
onavailable=""
onunavailable=""
onenable=""
ondisable=""
mute="true"
/>

<plugin name="soundinterface"
url.flash="plugins/soundinterface.swf"
url.html5="plugins/soundinterface.js"
preload="true"
rootpath=""
volume="1.0"
/>

	<!-- start playing the sound -->
	<events name="currentpano"
onnewpano="playsound(bgsnd, 'assets/sound.mp3', 0);"
onremovepano="stopsound(bgsnd);"
/>

	<!-- a button to pause/play the sound -->
	<plugin name="snd" url="soundonoff.png" align="leftbottom" x="10" y="10" alpha="0.5" scale="0.5" onover="tween(alpha,1);" onout="tween(alpha,0.5);"
crop="0|0|50|50"
onclick="pausesoundtoggle(bgsnd); switch(crop, 0|0|50|50, 0|50|50|50);"
/>

<!-- pano -->
<!-- include the videoplayer plugin -->
<plugin name="video"
url.flash="plugins/videoplayer.swf"
url.html5="plugins/videoplayer.js"
videourl="assets/video.m4v|assets/video.webm"
panovideo="true"
loop="true"
/>

<!-- define the pano image and refer to the videoplayer plugin -->
<image>
<sphere url="plugin:video" />
</image>

<!-- view/fov settings -->
<view hlookat="0" vlookat="0" fovtype="VFOV" fov="90" fovmin="30" fovmax="150" />

</krpano>


I've updated to krpano 1.19-pr14 (build 2017-12-01), krpano 1.19-pr14 Sound Interface Plugin (build 2017-12-01) and krpano 1.19-pr14 Videoplayer Plugin (build 2017-12-01).

2

Friday, March 23rd 2018, 2:59pm

Issues seems to fix again when self explaining them *g*

Just needed to add an id to the embedpano and use the same for removepano.

Source code

1
embedpano({swf: 'vendors/krpano/video.swf', xml: 'vendors/krpano/video.xml', target: 'pano', mobilescale: 1.0, passQueryParameters: true, id: 'my_video'})



Source code

1
removepano('my_video')