Skip to main content

API Complete Guide

Now that you know how to install the video widget into your website, you may want additional control over it. We got you covered.

Before we dive deep into the features available, let's start with the video-ideas that you might be interested in pursuing:

  • Programatically open/close the video player
  • Completely remove the widget HTML code from the DOM
  • Programatically load a new video
// Expand the video player.
videodonut("open");
// Collapse the video player.
videodonut("close");
// Remove the widget from the DOM tree.
videodonut("remove");
// Load a new video.
videodonut("load", { videoId: "YOUR-VIDEO-ID" });

If you want to rename the globally available function videodonut, you can do so. Just rename it in the snippet used to add the widget.

window, document, "script", "videodonut", "https://js.videodonut.com/widget.js";

If you want to rename it to myvideo, it should become:

window, document, "script", "myvideo", "https://js.videodonut.com/widget.js";

The function calls should then be:

myvideo("init", "YOUR-VIDEO-ID");

Ready to Grow Your Business?Start using Video Donut today.

Add a stories-style video to your website to boost engagement and conversions.

Sign up for Free