Sie sind nicht angemeldet.

1

Donnerstag, 25. Juli 2019, 18:04

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:

Quellcode

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


Video Scene:

Quellcode

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"

Quellcode

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

Fortgeschrittener

Beiträge: 521

Wohnort: Berlin

Beruf: Software-Entwickler bei VR-Easy ( HTML, JS, PHP, krpano, C++, Java )

  • Nachricht senden

2

Donnerstag, 25. Juli 2019, 19:36

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

3

Freitag, 26. Juli 2019, 09:47

@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

Fortgeschrittener

Beiträge: 521

Wohnort: Berlin

Beruf: Software-Entwickler bei VR-Easy ( HTML, JS, PHP, krpano, C++, Java )

  • Nachricht senden

4

Freitag, 26. Juli 2019, 17:02

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

5

Sonntag, 28. Juli 2019, 15:08

@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

Fortgeschrittener

Beiträge: 521

Wohnort: Berlin

Beruf: Software-Entwickler bei VR-Easy ( HTML, JS, PHP, krpano, C++, Java )

  • Nachricht senden

6

Montag, 29. Juli 2019, 09:19

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.

Ähnliche Themen