1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
|
|
"use strict";(self.blocksyJsonP=self.blocksyJsonP||[]).push([[806,87],{3780:function(e,t,n){n.d(t,{d:function(){return i}});const i=function(e){return e&&"[object Function]"==={}.toString.call(e)?e():e}},9257:function(e,t,n){n.d(t,{O:function(){return i}});const i=function(){return"undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1)}},9679:function(e,t,n){n.d(t,{$0:function(){return o},Kz:function(){return a},Vz:function(){return c},pF:function(){return d},r:function(){return s},v3:function(){return r},zT:function(){return i}});const i=function(e){e.closest(".ct-media-container, .ct-dynamic-media").dataset.state="playing"},o=function(e){e&&(e.matches('iframe[src*="youtu"]')?e.contentWindow.postMessage(JSON.stringify({event:"command",func:"mute"}),"*"):e.matches('iframe[src*="vimeo"]')&&e.contentWindow.postMessage(JSON.stringify({method:"setMuted",value:!0}),"*"))},a=function(e){e&&(e.matches("video")?e.play():e.matches('iframe[src*="youtu"]')?e.contentWindow.postMessage(JSON.stringify({event:"command",func:"playVideo"}),"*"):e.matches('iframe[src*="vimeo"]')&&e.contentWindow.postMessage(JSON.stringify({method:"play"}),"*"))},r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};e&&(e.matches("video[autoplay]")||e.matches('iframe[src*="youtu"][src*="autoplay=1"]')||e.matches('iframe[src*="vimeo"][src*="autoplay=1"]')?(t(),a(e)):n())},c=function(e){e.closest(".ct-media-container, .ct-dynamic-media").dataset.state="paused"},s=function(e){if(e)if(e.matches("video"))e.pause();else if(e.matches('iframe[src*="youtu"]'))e.contentWindow.postMessage(JSON.stringify({event:"command",func:"pauseVideo"}),"*");else if(e.matches('iframe[src*="vimeo"]'))e.contentWindow.postMessage(JSON.stringify({method:"pause"}),"*");else if(e.matches("iframe")){const t=e.src;e.src="",e.src=t}},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(e)return e.matches("video")?(t("ready"),e.addEventListener("play",(function(){return t("play")})),void e.addEventListener("pause",(function(){return t("pause")}))):e.matches('iframe[src*="youtu"]')?(window.addEventListener("message",(function(n){if(n.data&&n.source===e.contentWindow)try{const e=JSON.parse(n.data);"onStateChange"===e.event&&(1===e.info&&t("play"),2===e.info&&t("pause"))}catch(n){}})),void e.addEventListener("load",(function(){e.contentWindow.postMessage(JSON.stringify({event:"listening",id:1,channel:"widget"}),"*"),e.contentWindow.postMessage(JSON.stringify({event:"command",func:"addEventListener",args:["onStateChange"],id:1,channel:"widget"}),"*"),t("ready")}))):void(e.matches('iframe[src*="vimeo"]')&&window.addEventListener("message",(function(n){if(n.data&&n.source===e.contentWindow)try{const i=JSON.parse(n.data);"ready"===i.event&&(e.contentWindow.postMessage(JSON.stringify({method:"addEventListener",value:"pause"}),"*"),e.contentWindow.postMessage(JSON.stringify({method:"addEventListener",value:"play"}),"*"),t(i.event)),"pause"!==i.event&&"play"!==i.event||t(i.event)}catch(n){}})))}},4087:function(e,t,n){n.r(t),n.d(t,{fetchVideoBy:function(){return f},mount:function(){return v}});var i=n(9679),o=n(9257),a=n(2248),r=n(3780);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimi
|