Adding Buttons?

According to html - Youtube iframe "loop" doesn't work - Stack Overflow you also need to include playlist=<VIDEO-ID>.

As for the sound playing even after the video is closed, there was a typo in my script: you have to replace innerHtml with innerHTML.

I’ve edited my previous post to include these two changes.

Hey,

I’m trying to implement this code but is not working :thinking: what am I missing

Do you mean the button doesn’t show up, or the video doesn’t play?

Button is not showing up

Could you share a link to the scene, so we could take a look at it?

This is the link: https://meet.kazooie.io/ventusst/

This is my code:

<script>

  const viewer = WALK.getViewer();

  viewer.onSceneReadyToDisplay(function() {

    const button = viewer.addMenuButton('<https://icons.kazooie.io/shopping_cart.svg>');

    const container = document.getElementById('ext-html-label');

    const content = document.getElementById('ext-html-label-content');

    const close = document.getElementById('ext-html-label-close');

    button.onclick = function() {

      container.style.display = '';

      container.dataset.id = 'menu-button';

      content.innerHTML = '<iframe width="560" height="315" src="https://www.youtube.com/embed/u2hYn_4yuhc?controls=0&amp;start=77" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';

      close.onclick = function() {

        container.style.display = 'none';

        container.dataset.id = undefined;

        content.innerHTML = '';

      };

    }

  });

</script>

well the code is there in the separe index.html @wojtek

  1. I don’t see your code in the source of https://meet.kazooie.io/ventusst/. Have you placed the modified index.html or body-end.html in the scene folder before uploading the scene?

  2. viewer.addMenuButton('<https://icons.kazooie.io/shopping_cart.svg>') shouldn’t use angle brackets from the example placeholder. Change it to viewer.addMenuButton('https://icons.kazooie.io/shopping_cart.svg') .

1 Like

Hi, sorry for the absense:

  • Here you have a new scene files:

(link removed)

Could you write in more details what the issue with the button in this scene is? The extra menu button shows up and opens a pop-up with YT video when clicked.

1 Like

Hey Woj,

You are completely right, I guess I messed up my scenes…I’m improving my organization in order to prevent these flaws. Thanks.

Hi there i was wondering if there is a possibility to have a button displayed for the Swap objects function instead of the triggers.
For example i have an apartment and the client want to see the space empty as delivered to the buyer and filled with furniture to express posibilities of dexoration etc.
But its akward to navigate back to the space where the trigger is located to se the difference in the rooms

There is a Hide in views function that can be configured in the Objects tab. With it you can configure all the furniture to be hidden in, for example, an ‘Empty space’ view. Buttons to switch views are always available in the upper right corner.

Yeah didnt think doing it that way beacuse swap objects is easy in terms the same button appears and dissapears while using hide objects will need two buttons but its a good solution, but then how if pressed the view with hidden objects how to avoid camera movment?
So im in an apartments scene with 6 apartments and if i configure a hiiden objects view while in apartment 1 and im.in apartment 4 i would have to wall back to apartment 4 after pressing the hidden objects view button.

Unfortunately, with the top views menu it is not possible to apply objects visibility configuration without moving the camera to the view.

Funcionou, mas como eu faço para clicar no menu-button e ele fechar?

Sorry, I don’t understand the question. Could you write in more detail what you’d like to achieve?

good day,

im adding a body-end.html on my scene but it fails to upload, saying that i must upgrade my license first or remove the html file.
im using the standard plan.

HTML/Javascript customization is available starting from the Plus plan (see Subscription plans | Shapespark)