Beiträge von oscar.vanderleij

    Solved it by using a plugin for iOS devices and a plugin for non-iOS devices.

    I'm using the soundinterface to play a sound.

    Code
    <events name="currentpano"
    onnewpano="playsound(bgsnd, 'assets/sound.mp3|assets/sound.ogg', 0);"
    onremovepano="stopsound(bgsnd);"
    />
    
    
    <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);"
    />

    From the HTML5 and iOS (iPhone / iPad) Notes I read:
    A sound can't start to play automatically! An user interaction is needed to start playing the sound, e.g. a touch on the screen by the user. The krpano soundinterface plugin automatically detects that situations and when the playing is not possible it automatically queues the playsound() command and waits for the next user interaction to start the sound automatically (e.g. when the user touches the screen to pan the pano or to click a button).

    This results on iOS that when there is no sound the "sound on" icon is visible and when the user taps the sound icon the sounds starts playing but the "sound off" icon is displayed. This is the opposite of what I want and how it works on other devices.

    How can I invert the crop state on iOS devices or even better make it depend on whether the sound is playing or not?

    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:

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

    The full xml file content:

    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).

    I have it working in React by having the krpano container outside the React app container.

    Code
    <div id="app"></div><div id="pano"></div>

    When calling the embedpano method it loads the 360 video / photo.

    I only have an issue with my single page application. When I route to the next page having the 360 video it gives a "FATAL ERROR: LICENSE ERROR - WRONG DOMAIN". When I refresh the page it does work without error.

    Trying a quick and dirty workaround by reloading the page once, but a more solid solution is appreciated *g*