document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".bppiv_panorama_video2").forEach((e=>{const t=e.querySelector("video").getAttribute("id");let i={};try{i=JSON.parse(e.getAttribute("data-attributes"))}catch(e){i={}}const{enabledInitialView:n,initialView:o}=i,a=window.videojs(t,{width:getComputedStyle(e).width||"640",controls:!0,autoplay:!1,html5:{nativeControlsForTouch:!1}});a.mediainfo=a.mediainfo||{},a.mediainfo.projection="equirectangular",window.player=a;const d=a.vr({projection:"AUTO",debug:!0,forceCardboard:!1,antialias:!1});if(window.vr=d,a.on("ready",(()=>{d.camera&&"1"===n&&(d.camera.position.setX(o.top||0),d.camera.position.setY(o.right||0),d.camera.position.setZ(o.bottom||1))})),document.getElementById("wp-admin-bar-edit")){const t=document.createElement("div");t.classList.add("camera_position_wrapper"),e.appendChild(t);const i=document.createElement("button");i.innerText="Get Camera Position",t.appendChild(i);const n=document.createElement("p");i.addEventListener("click",(function(){t.appendChild(n),n.innerHTML=JSON.stringify(d.camera.position)+" <br /> this is only for admin. user can't see this",t.appendChild(o)}));const o=document.createElement("button");o.classList.add("close"),o.innerText="x",o.addEventListener("click",(()=>{t.removeChild(n),t.removeChild(o)}))}}))}));