videointerface_addsource and several videos

  • Can anyone enlighten me on how to set several videos scenes in same pano ?

    here is an example:

    First time I go to myVideo1 or myVideo2, all is good
    if I switch to the other video, the quality menu is empty !

    How can I reset the quality sub menu to add new sources ?

  • Hey, this post was vital to overcome this, because I found the exact same difficulty.

    You need to clear the array in order to work properly.

    First time using arrays in Krpano, it was not that easy to undersantand the few documentation on how to control them.
    Of cource you can use a loop, but it should be easier to check what's inside the array or object, like a print_r($array); in PHP.

    So I needed to clear all the items in an array to find space for a second video with other quality settings and did not find a delete array command, just using the videointerface_addsource action on videointerface.xml as a way to substitute item won't cut it.

    Finally understood the right syntax, but found strangely that a loop will only delete half of the items. So for a 6 items arrays I had to apply 3 times the same loop. Don't understand why, but this code helped me in this scenario:

    Code
    set(skin_video_setup_done, false);
    trace(videosources.count); 
    for(set(i,0), i LT videosources.count, inc(i),
    	trace(get(i));
    	trace(videosources[get(i)].sourcename);
    	trace(videosources[get(i)].videourl);
    	trace(videosources[get(i)].posterurl);
    	videosources.removearrayitem(get(i));
    );
    trace(videosources.count);

    Updates on array scripting would be highly appreciated!

  • Hi,

    i added a remove sources method in videointerface.xml :

    Code
    <action name="videointerface_removesources">
        trace('remove sources');
        set(skin_video_setup_done, false);
        loop(videosources.count, videosources.removearrayitem(0););
    </action>

    in my videopano.xml file :

Jetzt mitmachen!

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