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.
// Collapse the video player.
// Remove the widget from the DOM tree.
// 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", "";

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

window, document, "script", "myvideo", "";

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