How to display a youtube video after stopping

Here is a solution. It uses the Youtube API via a script in the Head HTML.

Instead of a HTML Widget I’ve used a Rectangle Element and inside that placed this code which gets replaced by the youtube iFrame

<div id="player"></div>

from then on you need to edit the Head HTML and add a function at the bottom

stopVideo = function () {
    player.stopVideo();
  }

you can then call this from anywhere in Hype to stop the video.

video_test-vDBear.hype.zip (24.0 KB)