PageSourceSearch

https://docs.usebasin.com/javascripts/privacy-video.js

js usebasin.com collected 2026-09-25 22:57:05 UTC 1,948 bytes, 68 lines download raw bytes

1(function () {
2  var YOUTUBE_EMBED = "https://www.youtube-nocookie.com/embed/";
3  var LOOM_EMBED = "https://www.loom.com/embed/";
4
5  function embedUrl(provider, id) {
6    if (provider === "loom") {
7      return LOOM_EMBED + id;
8    }
9
10    return YOUTUBE_EMBED + encodeURIComponent(id) + "?autoplay=1";
11  }
12
13  function createIframe(container) {
14    var provider = container.getAttribute("data-provider") || "youtube";
15    var id = container.getAttribute("data-id");
16    var title = container.getAttribute("data-title") || "Video";
17
18    if (!id) {
19      return;
20    }
21
22    var iframe = document.createElement("iframe");
23    iframe.className = "privacy-video__iframe";
24    iframe.src = embedUrl(provider, id);
25    iframe.title = title;
26    iframe.setAttribute("allowfullscreen", "");
27    iframe.setAttribute(
28      "allow",
29      "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
30    );
31    iframe.setAttribute("referrerpolicy", "strict-origin-when-cross-origin");
32    iframe.setAttribute("frameborder", "0");
33
34    container.innerHTML = "";
35    container.appendChild(iframe);
36    container.classList.add("privacy-video--loaded");
37    iframe.focus();
38  }
39
40  function bind(container) {
41    if (container.getAttribute("data-privacy-video-bound") === "true") {
42      return;
43    }
44
45    container.setAttribute("data-privacy-video-bound", "true");
46
47    var button = container.querySelector(".privacy-video__button");
48    if (!button) {
49      return;
50    }
51
52    button.addEventListener("click", function () {
53      createIframe(container);
54    });
55  }
56
57  function initPrivacyVideos() {
58    document.querySelectorAll(".privacy-video").forEach(bind);
59  }
60
61  if (typeof document$ !== "undefined") {
62    document$.subscribe(initPrivacyVideos);
63  } else if (document.readyState === "loading") {
64    document.addEventListener("DOMContentLoaded", initPrivacyVideos);
65  } else {
66    initPrivacyVideos();
67  }
68})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.