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

Thursday, July 25th 2019, 6:04pm

Change controls for photo and video in same tour

Hey,

currently I'm trying to make a tour with photos and videos. Both are stored in different scenes. For the videos i use the video plugin.

Photo scene:

Source code

1
2
3
4
5
6
7
<scene [...]>
	<view [...]>
	<image>
		<sphere url="..." />
	</image>
	[...]
</scene>


Video Scene:

Source code

1
2
3
4
5
6
7
8
9
10
<scene [...]>
	<plugin name="video" onloaded="addvideosources();">
	<image>
		<sphere url="plugin:video" />
	</image>
	<view [...]>
	<action name="addvideosources">
		[...]
	</action>
</scene>


So for switching the skins (for multiresolution videos, better timeline control, etc.) I used the "demotour-corfu-skinselect" example as the base. It consists of a loader xml which handles the skin selection and a rout.xml.

My loader xml is "parent.xml"

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
<krpano>
        <action name="testing" autorun="onstart">
            if(
                get(design)===null,
                    trace("initial run and parameter set");
                    change_skin_design('normal',mid);,
            );
        </action>

	<!-- no loading text, keep thumbs opened state -->
	<skin_settings loadingtext="" thumbs_opened="calc:skin_thumbs_last_state === 'opened' ? true : false" />
	
	<action name="change_skin_design">
                set(startscene,%2);
                if(%1!=null,set(design,%1),);
                trace(get(design));
		loadpanoscene("/showroom/parent.xml", %2, null, IGNOREKEEP, NOBLEND);
	</action>

	<!-- include optionally different skin -->
	<include url="/showroom/krpano/skin/videointerface.xml" if="design == 'video'"  />
	<include url="/showroom/krpano/skin/vtourskin.xml" if="design == 'normal'"  />
        
	<!-- include the corfu tour -->
        <include url="/showroom/showroom.xml" />
</krpano>


When first called, it sets the variable "design" (the skin reference) to its default value "normal". This ist done BEFORE the skins are included with an if statement (see https://krpano.com/forum/wbb/index.php?p…&threadID=13439).

The "tour.xml" calls when clicking on an hotspot the "change_skin_design('video',%EXAMPLESCENENAME%);" action. But the result is the videointerface control buttons being loaded on top of the old controls.

Image of the result: https://imgur.com/a/g50oEl1

Does anybody have an idea how to load the videointerface skin correctly or how to remove the old skin an control buttons when loading a new scene?


Thanks a lot

chaotic bruno

toosten

Intermediate

Posts: 465

Location: Berlin

Occupation: freier Software-Entwickler ( HTML, JS, PHP, JSP, Flash, AS3, C++, Java, krpano, ---)

  • Send private message

2

Thursday, July 25th 2019, 7:36pm

<scene name="..." onstart="showVideoContol()">
...
<scene name="..." onstart="showPanoContol()">
...

3

Friday, July 26th 2019, 9:47am

@toosten,

these two actions are nowhere defined in the files of krpano. So it gives me "WARNING: Unknown action: showpanocontrol" .
Since these actions don't exist in any of the example skins: are there skins with this feature available elsewhere in the forums?

Another try was to do "removelayer(skin_layer);" and then loading the skin again with "loadpano("/showroom/krpano/skin/videointerface.xml", null, null, null);".
But after removing the skin_layer, krpano couldn't find the scenes via "loadpanoscene("/showroom/showroom.xml", %2, null, IGNOREKEEP, NOBLEND);". But the scene clearly exists in showroom.xml.


Thanks for your help!

toosten

Intermediate

Posts: 465

Location: Berlin

Occupation: freier Software-Entwickler ( HTML, JS, PHP, JSP, Flash, AS3, C++, Java, krpano, ---)

  • Send private message

4

Friday, July 26th 2019, 5:02pm

Diese beiden Actions mußt du erstellen, um jeweis die gewünschen Elemente ein-/auszublenden. *thumbsup*

5

Sunday, July 28th 2019, 3:08pm

@toosten

Das Ergebnis https://imgur.com/a/g50oEl1 war bereits NUR das Video-Skin. Das Problem bei der ganzen Geschichte sind die Aktionen, die in den Skins (vtour und video) teilweise gleiche Namen hatten. Somit wurden zwar beim Laden einer Video-Szene mit dem Flag "IGNOREKEEP" die ganzen Layer von dem vorherigen Skin entfernt, jedoch blieben die Aktionen und Events von vtour erhalten und brachten damit die Formatierung der Kontrollelemente durcheinander.

Indem allen Layern, Aktionen und Events ein individueller Name in den XML's gegeben wurde, lädt eine neue Szene korrekt. (hierfür habe ich im video skin alle Positionen, in denen "skin_" stand mit "skin_video_" ersetzt)

Am schönsten wäre es natürlich, wenn man in der XML ein Dummy-Element à la "<div>" hinzufügen könnte, mit dem man nicht nur die Layer, sondern auch Aktionen und Events löschen kann, die man durch das Inkludieren eines Skins geladen hat.

toosten

Intermediate

Posts: 465

Location: Berlin

Occupation: freier Software-Entwickler ( HTML, JS, PHP, JSP, Flash, AS3, C++, Java, krpano, ---)

  • Send private message

6

Monday, July 29th 2019, 9:19am

Am schönsten wäre es natürlich, wenn man in der XML ein Dummy-Element à la "<div>" hinzufügen könnte, mit dem man nicht nur die Layer, sondern auch Aktionen und Events löschen kann, die man durch das Inkludieren eines Skins geladen hat.


Im Javascript können auch keine zwei Skriptdateien mit dem selben Funktionsnamen verwendet werden ohne das es zu Problemen kommt.
Bei diversen Compilersprachen würde man beim Kompilieren Fehlermeldungen bekommen oder mindestens Warnungen.

Similar threads