Back to the Shapespark home page

Adding Buttons?

According to 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.


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:

This is my code:


  const viewer = WALK.getViewer();

  viewer.onSceneReadyToDisplay(function() {

    const button = viewer.addMenuButton('<>');

    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() { = ''; = 'menu-button';

      content.innerHTML = '<iframe width="560" height="315" src=";start=77" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';

      close.onclick = function() { = 'none'; = undefined;

        content.innerHTML = '';





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

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

  2. viewer.addMenuButton('<>') shouldn’t use angle brackets from the example placeholder. Change it to viewer.addMenuButton('') .

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.