Pete Buttigieg explained why he keeps going on Fox News and it’s just so wholesome

0
201


Advertisement

Keep Reading
Show less

Advertisement

function rm_fn_e3323212a5c1a85caff08537172126b3() { function fbvideoID(frame) { var myRegexp = /2F(d+)%/g; var match = myRegexp.exec(frame); return match[1]; } var fbIframe = document.querySelector('iframe[src^="https://www.facebook.com/plugins/video.php?"]'); if (fbIframe) {fvVidID = fbvideoID(fbIframe.getAttribute('src')); if (fvVidID) { fbIframe.insertAdjacentHTML("beforebegin", '

Advertisement

'); // fbIframe.parentNode.removeChild(fbIframe); } } var videoId = "promoted-video"; var oldFacebookVideo = document.getElementById(videoId); if (!oldFacebookVideo) { return }; var facebookVideoPost = oldFacebookVideo.closest(".widget"); if (!facebookVideoPost) { return };

var facebookVideo = facebookVideoPost.querySelector("#" + videoId); facebookVideo.classList.add("fb-video"); var firstPost = document.querySelector(".widget.post-partial");

function onScriptLoad() { FB.init({ appId: window.REBELMOUSE_BOOTSTRAP_DATA.fbId, version: window.REBELMOUSE_BOOTSTRAP_DATA.fbAppVersion, status: true, cookie: true, }); FB.XFBML.parse(); if(fbIframe){ fbIframe.parentNode.removeChild(fbIframe); } }

function loadFacebookScript() { var existingScript = document.querySelector('script[src="https://connect.facebook.net/en_US/sdk.js"'); if (!existingScript) { var script = document.createElement("script"); script.src = "https://connect.facebook.net/en_US/sdk.js"; document.head.appendChild(script); script.addEventListener("load", onScriptLoad); } }

Advertisement

function intersectorCallback(video_player) { var booted = false; var totalSeconds = 0; var interval = null;

function impressionCounter() { totalSeconds++; console.log("I've been watching for " + totalSeconds + " seconds"); } return function intersector(entries) { var entry = entries[0]; if (entry.isIntersecting) { if (!booted) { booted = true; video_player.mute(); video_player.play(); } interval = setInterval(impressionCounter, 1000); } else { if (interval) { console.log("I've stopped watching at " + totalSeconds + " seconds"); clearInterval(interval); interval = null; } } }; }

function trackVideo(video_player) { var observer = new IntersectionObserver(intersectorCallback(video_player), {}); observer.observe(facebookVideo); }

function onFacebookElementLoaded(msg) { if (msg.type === "video" && msg.id === videoId) { trackVideo(msg.instance); } }

function onFacebookReady() { FB.Event.subscribe("xfbml.ready", onFacebookElementLoaded); if (window.oldFacebookWaiter) window.oldFacebookWaiter(); }

Advertisement
Advertisement

if ("FB" in window) { onFacebookReady(); } else { window.oldFacebookWaiter = window.fbAsyncInit; window.fbAsyncInit = onFacebookReady; loadFacebookScript(); } } window.REBELMOUSE_TASKS_QUEUE.push(rm_fn_e3323212a5c1a85caff08537172126b3);





Source link

Advertisement
Advertisement