PageSourceSearch

https://idx.joinbulletproof.com/video_controls/video_play.js

js joinbulletproof.com collected 2026-09-24 13:04:27 UTC 17,669 bytes, 302 lines download raw bytes

1(function () {
2  const video_load = (url, cb) => {
3    var xmlhttp;
4    xmlhttp = new XMLHttpRequest();
5    xmlhttp.onreadystatechange = function () {
6      if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
7        cb(xmlhttp.responseText);
8      }
9    };
10    xmlhttp.open('GET', url, true);
11    xmlhttp.send();
12  };
13
14  const video_cdn = () => {
15    if (document.getElementById('video_cdn_inline')) return;
16
17    var style = document.createElement('style');
18    style.id = 'video_cdn_inline';
19    style.textContent = `
20  body { margin: 0; padding: 0; }
21  .video_playBtn .videoplay_icon { width: 80%; height: 80%; background: transparent url("https://idx.joinbulletproof.com/video_controls/images/play_icn.png"); background-repeat: no-repeat; position: absolute; inset: 0%; margin: auto; background-size: 20%; background-position: center center; z-index: 9; cursor: pointer; display: block; border: none; }
22  .video_playBtn .sound_btn { position: relative; z-index: 1; display: block; }
23  .video_playBtn .sound_btn img { width: 115px; top: 0; left: 0; padding: 5px; position: absolute; margin-top: 5px; margin-left: 10px; animation: 2s ease-out 0s infinite normal none running pulse; }
24  .video_playBtn { display: block; }
25  .video-classycorner { position: absolute; z-index: 9; width: 120px; display: flex; align-items: center; overflow: hidden; }
26  .video-frontcenter { position: absolute; z-index: 9; display: flex; align-items: center; overflow: hidden; width: 100%; left: 0; right: 0; top: 0; bottom: 0; margin: auto; cursor: pointer; }
27  .video-loudface { position: absolute; z-index: 9; display: flex; align-items: center; overflow: hidden; width: 100%; height: 100%; }
28  .replay-unmute { position: relative; overflow: hidden; }
29  #ap_video_1, #ap_video_2, #ap_video_3, #ap_video_4, #ap_video_5, #ap_video_6, #ap_video_7, #ap_video_8, #ap_video_9, #ap_video_10 { padding: 0px !important; }
30  .sa-theme-wrapper { position: relative; outline: none; border: 0px; font-size: 16px; color: #ffffff; text-align: center; cursor: pointer; border: 2px solid rgba(255,255,255,0.5); margin: auto; }
31  .video-loudface .sa-theme-wrapper { height: 100%; }
32  .sa-unmute { max-width: 100%; height: 100%; margin: auto; padding: 20px 25px; font-family: Tahoma, Arial, Helvetica, sans-serif; font-weight: bold; }
33  .sa-message-unmute, .sa-message-unmute p, .sa-message-unmute h4 { color: inherit; padding: 0px; margin: 0px; }
34  .sa-message-unmute h4 { padding-bottom: 5px; padding-top: 5px; text-shadow: 0px 3px 7px rgba(0,0,0,0.5); }
35  .sa-message-unmute p { padding-bottom: 5px; text-shadow: 0px 3px 7px rgba(0,0,0,0.5); }
36  .sa-volume-icon-animated { padding-bottom: 5px; padding-top: 5px; width: 50px; height: auto; text-align: inherit; margin: auto; }
37  .sa-volume-icon-animated svg { outline: none; width: 70%; }
38  .sa-hide { display: none; }
39  .sa-unhide { display: block; }
40  .sa-animation-breathe-unmute { animation: breathe 3.2s ease-in-out infinite normal; }
41  .sa-large-size { font-size: 40px; }
42  .sa-unmute-topbottom { margin-top: 20px !important; margin-bottom: 20px !important; }
43  .sa-lefttopzero { left: 0px; top: 0px; }
44  @keyframes breathe { 0% { opacity: 1; transform: scale(1); } 30% { opacity: .1; transform: scale(1.04); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 1; transform: scale(1); } }
45  #classy-corner { max-width: 100px; margin: 10px auto; padding: 0px; border: 1px solid rgba(255,255,255,0.05); }
46  #front-and-center { max-width: 300px; margin: 10px auto; padding: 0px; }
47  #front-and-center .sa-volume-icon-animated { width: unset; scale: 0.65; }
48  #classy-corner .sa-volume-icon-animated { scale: 0.50; width: unset; padding-bottom: 0px; height: 50px; padding-top: 0px; margin-top: -5px; margin-bottom: 2px; }
49  #classy-corner .sa-unmute { padding: 20px 10px; }
50  #loud-in-your-face { width: 100%; margin: 10px auto; padding: 0px; display: flex; align-items: center; border: 0px solid rgba(85,75,75,0); }
51  #loud-in-your-face svg { width: 80px; }
52  #loud-in-your-face .sa-unmute { height: unset; }
53  .layer1 { animation: 1.2111s linear -0.694444s infinite normal forwards running blink; }
54  .layer2 { animation: 1.2111s linear -0.833333s infinite normal forwards running blink; }
55  .layer3 { animation: 1.2111s linear -0.972222s infinite normal forwards running blink; }
56  @keyframes blink { 0% { opacity: 0; } 50% { opacity: .70; } 100% { opacity: 1; } }
57  @media only screen and (min-width: 1024px) { .sa-volume-icon-animated svg { height: 70px !important; width: auto !important; margin: 10px auto !important; } }
58  @media only screen and (max-width: 1024px) { #loud-in-your-face svg { width: 6vw; } #loud-in-your-face .sa-unmute-topbottom { margin-top: 2vw !important; margin-bottom: 2vw !important; } #loud-in-your-face h4, #loud-in-your-face p { font-size: 3vw; } #loud-in-your-face svg { width: 5vw; } }
59  @media only screen and (max-width: 768px) { #loud-in-your-face h4, #loud-in-your-face p { font-size: 5vw; } #loud-in-your-face svg { width: 8vw; } #classy-corner .sa-volume-icon-animated { scale: 0.75; } }
60    `;
61    document.head.appendChild(style);
62  };
63
64  const video_play = function () {
65    var v_autoplay = '';
66    var v_autoplay_id = document.getElementById('video_scriptID');
67    if (document.body.contains(v_autoplay_id)) {
68      if (v_autoplay_id.hasAttribute('video_autoplay_msg')) {
69        v_autoplay = v_autoplay_id.getAttribute('video_autoplay_msg');
70      }
71    }
72    return v_autoplay;
73  };
74
75  const video_topText = function () {
76    var video_tText = '';
77    var video_tText_att = document.getElementById('video_scriptID');
78    if (document.body.contains(video_tText_att)) {
79      if (video_tText_att.hasAttribute('data-top-text')) {
80        video_tText = video_tText_att.getAttribute('data-top-text');
81      }
82    }
83    return video_tText;
84  };
85
86  const video_bottomText = function () {
87    var video_bText = '';
88    var video_bText_att = document.getElementById('video_scriptID');
89    if (document.body.contains(video_bText_att)) {
90      if (video_bText_att.hasAttribute('data-bottom-text')) {
91        video_bText = video_bText_att.getAttribute('data-bottom-text');
92      }
93    }
94    return video_bText;
95  };
96
97  const video_textcolor = function () {
98    var video_textcolor = '';
99    var video_textcolor_att = document.getElementById('video_scriptID');
100    if (document.body.contains(video_textcolor_att)) {
101      if (video_textcolor_att.hasAttribute('data-text-color')) {
102        video_textcolor = video_textcolor_att.getAttribute('data-text-color');
103      }
104    }
105    return video_textcolor;
106  };
107
108  const video_dropshadow = function () {
109    var v_shadow = '';
110    var v_shadow_att = document.getElementById('video_scriptID');
111    if (document.body.contains(v_shadow_att)) {
112      if (v_shadow_att.hasAttribute('data-dropshadow')) {
113        v_shadow = v_shadow_att.getAttribute('data-dropshadow');
114      }
115    }
116    return v_shadow;
117  };
118
119  const initiate_video_autoplay = video_play();
120
121  const video_classycorner = 'ClassyCorner';
122  const video_frontcenter = 'FrontCenter';
123  const video_loudface = 'LoudFace';
124
125  const initiate_playBtn = () => {
126    var xVideoBtn_div = document.querySelector('.video_replay');
127    var xVideoElem_ready = document.querySelector('.vjs-tech');
128    if (!document.body.contains(xVideoElem_ready)) {
129      setTimeout(initiate_playBtn, 250);
130    } else {
131      var i = 1;
132      document.querySelectorAll('.video_replay').forEach((row) => {
133        var row_id = 'ap_video_' + i;
134        row.setAttribute('id', row_id);
135
136        var row_obj = document.getElementById(row_id);
137        const newDivNode = document.createElement('div');
138
139        if (initiate_video_autoplay === video_loudface) {
140          newDivNode.innerHTML = `
141                <div id="loud-in-your-face" class="sa-theme-wrapper videoplay_icon sa-lefttopzero" style="color: ${video_textcolor()}">
142                    <div class="sa-unmute">
143                        <div class="sa-message-unmute"> 
144                            <h4 class="sa-animation-breathe-unmute sa-large-size">${video_topText()}</h4>
145                        </div>  
146                        <div class="sa-volume-icon-animated sa-unmute-topbottom">
147                            <svg class="sa-animation-breathe-unmute" viewBox="0 0 510 449" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 50px; height: 50px">
148                                <path d="M380.5 48C479 96.5 567 296 380.5 418" stroke="currentColor" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" class="layer1"/>
149                                <path d="M347 122C406.472 151.1 459.604 270.8 347 344" stroke="currentColor" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" class="layer2"/>
150                                <path d="M302 178C330.835 192.288 356.596 251.059 302 287" stroke="currentColor" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" class="layer3"/>
151                                <path d="M132.5 310.5L237.385 394.037C240.661 396.646 245.5 394.313 245.5 390.126V78.1311C245.5 74.0806 240.936 71.7111 237.623 74.0418L132.5 148M132.5 310.5V148M132.5 310.5H20.5C17.7386 310.5 15.5 308.261 15.5 305.5V153C15.5 150.239 17.7386 148 20.5 148H132.5" stroke="currentColor" stroke-width="30" stroke-miterlimit="16" stroke-linecap="round"/>
152                                <path d="M429.5 15L64.5 433.5" stroke="currentColor" stroke-width="30" stroke-miterlimit="16" stroke-linecap="round"/>
153                            </svg>
154                        </div>
155                        <div class="sa-message-unmute">
156                            <p class="sa-animation-breathe-unmute sa-large-size">${video_bottomText()}</p>
157                        </div>  
158                    </div>
159                </div>
160                `;
161        }
161 else if (initiate_video_autoplay === video_frontcenter) {
162          newDivNode.innerHTML = `
163                <div id="front-and-center" class="sa-theme-wrapper videoplay_icon"  style="color: ${video_textcolor()}">
164                    <div class="sa-unmute" style="background-color: ${video_dropshadow()}">
165                        <div class="sa-volume-icon-animated">
166                            <svg viewBox="0 0 510 449" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 50px; height: 50px">
167                                <path d="M380.5 48C479 96.5 567 296 380.5 418" stroke="currentColor" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" class="layer1"/>
168                                <path d="M347 122C406.472 151.1 459.604 270.8 347 344" stroke="currentColor" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" class="layer2"/>
169                                <path d="M302 178C330.835 192.288 356.596 251.059 302 287" stroke="currentColor" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" class="layer3"/>
170                                <path d="M132.5 310.5L237.385 394.037C240.661 396.646 245.5 394.313 245.5 390.126V78.1311C245.5 74.0806 240.936 71.7111 237.623 74.0418L132.5 148M132.5 310.5V148M132.5 310.5H20.5C17.7386 310.5 15.5 308.261 15.5 305.5V153C15.5 150.239 17.7386 148 20.5 148H132.5" stroke="currentColor" stroke-width="30" stroke-miterlimit="16" stroke-linecap="round"/>
171                                <path d="M429.5 15L64.5 433.5" stroke="currentColor" stroke-width="30" stroke-miterlimit="16" stroke-linecap="round"/>
172                            </svg>
173                        </div>
174                        <div class="sa-message-unmute">
175                            <h4 class="">${video_topText()}</h4>
176                            <p class="">${video_bottomText()}</p>
177                        </div>  
178                    </div>
179                </div>
180                `;
181        } else if (initiate_video_autoplay === video_classycorner) {
182          newDivNode.innerHTML = `
183                    <div id="classy-corner" class="sa-theme-wrapper videoplay_icon"  style="color: ${video_textcolor()}">
184                    <div class="sa-unmute" style="background-color: ${video_dropshadow()}">
185                        <div class="sa-message-unmute">
186                            <h4 class="sa-hide">${video_topText()}</h4>
187                            <p>${video_bottomText()}</p>
188                        </div>
189                        <div class="sa-volume-icon-animated">
190                            <svg viewBox="0 0 510 449" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 50px; height: 50px">
191                                <path d="M380.5 48C479 96.5 567 296 380.5 418" stroke="currentColor" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" class="layer1"/>
192                                <path d="M347 122C406.472 151.1 459.604 270.8 347 344" stroke="currentColor" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" class="layer2"/>
193                                <path d="M302 178C330.835 192.288 356.596 251.059 302 287" stroke="currentColor" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" class="layer3"/>
194                                <path d="M132.5 310.5L237.385 394.037C240.661 396.646 245.5 394.313 245.5 390.126V78.1311C245.5 74.0806 240.936 71.7111 237.623 74.0418L132.5 148M132.5 310.5V148M132.5 310.5H20.5C17.7386 310.5 15.5 308.261 15.5 305.5V153C15.5 150.239 17.7386 148 20.5 148H132.5" stroke="currentColor" stroke-width="30" stroke-miterlimit="16" stroke-linecap="round"/>
195                                <path d="M429.5 15L64.5 433.5" stroke="currentColor" stroke-width="30" stroke-miterlimit="16" stroke-linecap="round"/>
196                            </svg>
197                            </div>
198                        </div>
199                    </div>
200                    `;
201        } else {
202          newDivNode.innerHTML = `
203                    <div class="sound_btn"><img src="https://idx.joinbulletproof.com/video_controls/images/unmute.webp" alt="Click To Turn On Sound"></div><button type="button" class="videoplay_icon"></button>`;
204        }
205
206        const textDivNode = document.createTextNode(' ');
207        newDivNode.className = 'video_playBtn';
208        newDivNode.appendChild(textDivNode);
209        row_obj.insertBefore(newDivNode, row_obj.children[0]);
210        i++;
211      });
212    }
213  };
214
215  const video_autoplay_addclass = () => {
216    const autplay_ele = document.querySelector('.video_playBtn');
217    if (!document.body.contains(autplay_ele)) {
218      setTimeout(video_autoplay_addclass, 250);
219    } else {
220      var i = 1;
221      document.querySelectorAll('.video_playBtn').forEach((divclass) => {
222        if (initiate_video_autoplay === video_loudface) {
223          divclass.classList.add('video-loudface');
224          divclass.style.backgroundColor = `${video_dropshadow()}`;
225        } else if (initiate_video_autoplay === video_frontcenter) {
226          divclass.classList.add('video-frontcenter');
227        } else if (initiate_video_autoplay === video_classycorner) {
228          divclass.classList.remove('video-frontcenter');
229          divclass.classList.remove('video-loudface');
230          divclass.classList.add('video-classycorner');
231        }
232      });
233      i++;
234    }
235  };
236
237  const initiate_replay = () => {
238    if (!document.body.contains(document.querySelector('.videoplay_icon'))) {
239      setTimeout(initiate_replay, 250);
240    } else {
241      document.querySelectorAll('.video_replay').forEach((btn) => {
242        btn.addEventListener('click', (event) => {
243          if (typeof btn.closest('.video_replay') !== 'undefined' && btn.closest('.video_replay')) {
244            var closest_replay_unmute_id = btn.closest('.video_replay').getAttribute('id');
245            var xVideo_unmute = document.querySelector('#' + closest_replay_unmute_id + ' video');
246            var xVideo_unmuteB = document.querySelector('#' + closest_replay_unmute_id + ' .autoplay');
247            var xVideo_playbtn = document.querySelector('#' + closest_replay_unmute_id + ' .video_playBtn');
248
249            if (document.body.contains(xVideo_unmute)) {
250              xVideo_unmute.autoplay = true;
251              xVideo_unmute.muted = false;
252              xVideo_unmute.currentTime = 0;
253            }
254
255            if (document.body.contains(xVideo_unmuteB)) {
256              xVideo_unmuteB.autoplay = true;
257              xVideo_unmuteB.muted = false;
258              xVideo_unmuteB.currentTime = 0;
259            }
260
261            if (document.body.contains(xVideo_playbtn)) {
262              xVideo_playbtn.style.display = 'none';
263              xVideo_playbtn.classList.remove('video_playBtn');
264              xVideo_playbtn.classList.remove('video-classycorner');
265              xVideo_playbtn.classList.remove('video-frontcenter');
266              xVideo_playbtn.classList.remove('video-loudface');
267              btn.classList.remove('video_replay');
268            }
269          }
270        });
271      });
272    }
273  };
274  const initiate_playBtn_event = () => {
275    var btns = document.querySelectorAll('.video_playBtn');
276    if (btns.length === 0) {
277      setTimeout(initiate_playBtn_event, 250);
278    } else {
279      btns.forEach((btn) => {
280        btn.addEventListener('click', (event) => {
281            btnHide.style.display = 'none';
282        });
283      });
284    }
285  };
286
287  /// not in use
288  const video_elems = function () {
289    const targetNode = document.querySelector('.c-video');
290    const config = { attributes: true, childList: true }; //, subtree: true
291    const observer = new MutationObserver(function (mutations) {
292      // initiate_playBtn();
293    });
294    observer.observe(targetNode, config);
295  };
296
297  video_cdn();
298  initiate_playBtn();
299  video_autoplay_addclass();
300  initiate_replay();
301  initiate_playBtn_event();
302})();

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.