Strange path for Sounds

  • I wanted to change my directories and I put all the data in a folder named data.
    Moved the start index.html out of it and changed the 3 links to the js, swf and xml files to data/

    To my surprise it now said that it can not find my sounds/sound.mp3.
    Everything says to me that it should be relative to the xml but it seems to be relative to the html so I had to change the links in xml to data/sounds/sound.mp3.

    Everything else worked perfect.

    This makes no sense to me.

    Hans

  • Well this turned out to be a complete miss.
    On iPad also all other element did not work.

    Why is this. Is there a special way you have to create the paths to work on iDevices.
    It seams that I have to keep the html in same directory as the xml.

    Hans

  • Hi Hans,

    Check this bit in the docs, https://krpano.com/docu/xml/#url-notes you can choose what you want to make your data relative to. Most people I believe use %SWFPATH% me included - so you can do %SWFPATH% /sounds/sound.mp3.Relatvie to where the krpano.swf is. I organise my folders like

    root folder

    index.html

    tour folder

    pano.xml's
    krpano.swf
    js folder
    panorama folders
    video, images, sound etc folders

    But of course you can do anyway you like, the missing piece of info you need is in the url notes.

    Best wishes,

    tom

  • Well it actually was the %SWFPATH% that did not work . I had left that on some of the buttons and even if it works on computers it does not work on the iPad.
    After changing it to standard ../ paths it all worked.

    But the sounds is a different thing. Why it needs to be relative to the html is just weird.

    Hans

  • Well it actually was the %SWFPATH% that did not work . I had left that on some of the buttons and even if it works on computers it does not work on the iPad.
    After changing it to standard ../ paths it all worked.

    But the sounds is a different thing. Why it needs to be relative to the html is just weird.

    Hans

    my guess would be becuase on the iphone and ipad there is no swf file to % against. swf is flash must not be loaded via html5 so there would have to be something else to reference .

  • Hi,

    sorry, I see the soundinterface documenation was wrong - the rootpath is relative to html file, not to the xml file, this was a flashplayer limitation, but by using placeholders like %SWFPATH%,%CURRENTXML%,%FIRSTXML% you can also use relative paths to these files,

    note about the soundinteface plugin for the krpanoJS viewer:
    - there is currently no "rootpath" there, but you can use the placeholders also direct in the playsound() call
    - the %SWFPATH% placeholder should work also there but it points to the javascript file of the krpano viewer,

    e.g. try:

    Code
    playsound(snd1, %CURRENTXML%/sound.mp3);

    best regards,
    Klaus

  • Sorry Klaus but there are problems also with the %SWFPATH% if you move the html outside the xml folder.
    This is a link to a test with html inside and the defaultskin has mixed linking some has %SWFPATH% and some new I added has ../
    http://360-foto.dk/vtour/vtour-path/tour2.html

    It works fine also on iPad

    Now we move it out of the xml folder and change the root for the soundinterface only
    http://360-foto.dk/vtour/tour.html
    Loads with no problem on desktop but fails on iPad saying it can not find the skin.
    After changing all the %SWFPATH% to ../ it works on both.
    http://360-foto.dk/vtour/tour1.html

    You can also test it in Safari.

  • Actually it is not just Soundinterface which has this problem.
    I discovered last night that the videoplayer performs exactly the same.

    If you move the html out of the rooth it becomes the one you need to use for relaive links.
    And the placeholders does not work on iPad.

    Hans

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!