PageSourceSearch

https://www.skymenu.net/_sitecommon/_js/modal/modal-video.js

js skymenu.net collected 2026-10-03 19:01:08 UTC 8,023 bytes, 7 lines download raw bytes

1var m=Object.defineProperty;var u=(a,e,t)=>e in a?m(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var r=(a,e,t)=>(u(a,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const s of n.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function o(i){if(i.ep)return;i.ep=!0;const n=t(i);fetch(i.href,n)}})();class p{constructor(){r(this,"modalEl");r(this,"videoContainer");r(this,"MIN_WIDTH",768);r(this,"TYPE_YOUTUBE","Youtube");r(this,"TYPE_MP4","mp4");r(this,"TYPE_S3","S3");r(this,"TYPE_VIMEO","Vimeo");r(this,"TYPE_JSTREAM","jStream");r(this,"jstreamScriptPromise",null);r(this,"isOpening",!1);r(this,"onClickedOpenButton",e=>{const t=e.currentTarget,o=this.filterDataAttr(t);o&&this.open(o)});r(this,"open",async e=>{if(!this.isOpening){this.isOpening=!0;try{const{type:t,src:o,title:i,poster:n,annotation:s}=e;if(window.innerWidth<this.MIN_WIDTH&&this.openExternalWindow(t,o)){this.sendGA(i,t);return}switch(t){case this.TYPE_YOUTUBE:this.createYoutubeContent(i,o,s);break;case this.TYPE_VIMEO:this.createVimeoContent(i,o,s);break;case this.TYPE_MP4:case this.TYPE_S3:this.createVideoContent(i,o,n,s);break;case this.TYPE_JSTREAM:await this.createJstreamContent(i,o,s);break;default:return}this.sendGA(i,t),this.modalEl.showModal(),this.modalEl.classList.remove("is-fadeout"),this.modalEl.classList.add("is-fadein"),document.body.style.overflow="hidden"}catch(t){console.error(t)}finally{this.isOpening=!1}}});r(this,"close",e=>{e.preventDefault(),this.modalEl.addEventListener("animationend",()=>{this.modalEl.close(),this.videoContainer.contentEl.innerHTML="",document.body.style.overflow="visible"},{once:!0}),this.modalEl.classList.remove("is-fadein"),this.modalEl.classList.add("is-fadeout")});this.modalEl=this.addModalEl(),this.videoContainer=this.initVideoContainer(),this.addOpenButtonEvent()}getRequiredElement(e){const t=document.querySelector(e);if(!t)throw new Error(`Required element not found: ${e}`);return t}addModalEl(){const e=location.hostname;let t="js-modalVideoWindow";switch(!0){case e.includes("skysea"):t+="--skysea";break;case e.includes("skydiv"):t+="--skydiv";break;case e.includes("skypce"):t+="--skypce";break}const o=document.createElement("dialog");return o.setAttribute("id","js-modalVideoWindow"),o.classList.add("is-fadeout",t),o.innerHTML=`
2      <div id="js-modalVideo__element">
3        <div></div>
4        <div id="js-modalVideo__annotation" style="display:none"></div>
5        <p id="js-modalVideo__elementTitle"></p>
6        <span id="js-modalWindowClose">閉じる</span>
7      </div>`,o.addEventListener("click",this.close),o.addEventListener("cancel",this.close),document.body.append(o),o}initVideoContainer(){const e=this.getRequiredElement("#js-modalVideo__element > div"),t=this.getRequiredElement("#js-modalVideo__elementTitle"),o=this.getRequiredElement("#js-modalVideo__annotation"),i=this.getRequiredElement("#js-modalWindowClose");return i.addEventListener("click",this.close),this.getRequiredElement("#js-modalVideo__element").addEventListener("click",n=>n.stopPropagation()),{contentEl:e,titleEl:t,annotationEl:o,closeButtonEl:i}}addOpenButtonEvent(){document.querySelectorAll(".js-modalVideo").forEach(t=>{t.dataset.isButtonEvent!=="true"&&(t.addEventListener("click",this.onClickedOpenButton),t.dataset.isButtonEvent="true")})}removeOpenButtonEvent(){document.querySelectorAll(".js-modalVideo").forEach(t=>{t.removeEventListener("click",this.onClickedOpenButton),t.dataset.isButtonEvent="false"})}createYoutubeContent(e,t,o){this.setContent(`<iframe id="js-modalVideo__elementMovie" src="https://www.youtube.com/embed/${t}" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen"></iframe>`,e,o)}createVimeoContent(e,t,o){this.setContent(`<div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/${t}&amp;badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479&quality=720p" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" style="position:absolute;top:0;left:0;width:100%;height:100%;" title="sample"></iframe></div>`,e,o)}createVideoContent(e,t,o,i){const n=o?` poster="/${o}"`:"";this.setContent(`<video controls preload="metadata" id="js-modalVideo__elementMovie"${n} src="${t}"></video>`,e,i)}async createJstreamContent(e,t,o){this.setContent('<div id="js-modalVideo-jstreamPlayer"></div>',e,o),await this.loadJstreamScript(),jstream_t3.PlayerFactoryIF.create({b:"eqh568kver.eq.webcdn.stream.ne.jp/www50/eqh568kver/jmc_pub/jmc_swf/player/",c:"NzQ2Mw==",m:t,s:{wp:800,hp:450,rp:"fit",bskb:"off",cpt:"off",dq:"0",mdq:"0",el:"off",fskb:"off",il:"off",ip:"off",is:"on",pr:"0.5,0.7,1.2,1.5,2.0",rb:"off",skb:"off",sn:"",tg:"off",ti:"off",wm:"off"}},"js-modalVideo-jstreamPlayer")}loadJstreamScript(){return this.jstreamScriptPromise?this.jstreamScriptPromise:(this.jstreamScriptPromise=new Promise((e,t)=>
7{const o=document.createElement("script");o.src="https://ssl-cache.stream.ne.jp/www50/eqh568kver/jmc_pub/jmc_swf/player/t3/if.js",o.onload=()=>e(),o.onerror=()=>t(new Error("JStream player script load error")),document.head.append(o)}),this.jstreamScriptPromise)}setContent(e,t,o){const{contentEl:i,titleEl:n,annotationEl:s}=this.videoContainer;i.innerHTML=e,n.innerHTML=t,s.innerHTML=o,s.style.display=o?"block":"none"}openYoutubeWindow(e){window.open(`https://www.youtube.com/watch?v=${e}`)}openVimeoWindow(e){const t=e.split("?h="),o=t[0]||"",i=t[1]||"";window.open(`https://www.skygroup.jp/event/player/?id=${encodeURIComponent(o)}&h=${encodeURIComponent(i)}`)}openVideoWindow(e){window.open(e)}openJstreamWindow(e){window.open(`https://www.skygroup.jp/event/player/jst.html?m=${encodeURIComponent(e)}`)}openExternalWindow(e,t){switch(e){case this.TYPE_YOUTUBE:return this.openYoutubeWindow(t),!0;case this.TYPE_VIMEO:return this.openVimeoWindow(t),!0;case this.TYPE_MP4:case this.TYPE_S3:return this.openVideoWindow(t),!0;case this.TYPE_JSTREAM:return this.openJstreamWindow(t),!0;default:return!1}}sendGA(e,t){typeof gtag=="function"&&gtag("event","btn_click",{event_category:t,event_label:e})}filterDataAttr(e){const t=e.dataset.youtube,o=e.dataset.vimeo,i=e.dataset.mp4,n=e.dataset.s3,s=e.dataset.jstream,d=e.dataset.ttl||"名称未設定",l=e.dataset.annotation||"",c=e.dataset.poster||null;return t?{type:this.TYPE_YOUTUBE,src:t,title:d,annotation:l,poster:c}:o?{type:this.TYPE_VIMEO,src:o,title:d,annotation:l,poster:c}:i?{type:this.TYPE_MP4,src:`/${i}`,title:d,annotation:l,poster:c}:n?{type:this.TYPE_S3,src:n,title:d,annotation:l,poster:c}:s?{type:this.TYPE_JSTREAM,src:s,title:d,annotation:l,poster:c}:null}}class h{constructor(){r(this,"thumbnailSelector",".movielist__vimeo");r(this,"imageAreaSelector",".movielist__img");this.addThumbnail()}async addThumbnail(){const e=document.querySelectorAll(this.thumbnailSelector);await Promise.all(Array.from(e,t=>this.addThumbnailToElement(t)))}async addThumbnailToElement(e){const t=e.dataset.vimeo;if(!t)return;const o=e.dataset.size?`_${e.dataset.size}`:"",i=await this.fetchVimeo(t.replace(/\?h=/,"/")),n=document.createElement("img"),s=i.thumbnail_url.split(`_${i.thumbnail_width}`)[0];n.src=s+o,n.alt=i.title,e.querySelectorAll(this.imageAreaSelector).forEach(d=>d.appendChild(n))}async fetchVimeo(e){return(await fetch(`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${e}/`)).json()}}window.addEventListener("DOMContentLoaded",function(){window.videoModal=new p,window.VideoThumbnail=new h});

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.