File "videopress-token-bridge.js"

Full Path: /home/warrior1/public_html/wp-content-20241001222009/plugins/jetpack/jetpack_vendor/automattic/jetpack-videopress/build/lib/videopress-token-bridge.js
File size: 715 bytes
MIME-type: text/plain
Charset: utf-8

window.addEventListener("message",(function(e){if(-1===["https://videopress.com","https://video.wordpress.com"].indexOf(e.origin))return;if("videopress_token_request"!==e.data.event)return;if(!window.videopressAjax)return;const s={action:"videopress-get-playback-jwt",guid:e.data.guid,post_id:window.videopressAjax.post_id||0};fetch(window.videopressAjax.ajaxUrl,{method:"POST",credentials:"same-origin",body:new URLSearchParams(s)}).then((function(e){if(e.ok)return e.json();throw Error("Response is not ok")})).then((function(o){o.success&&o.data?e.source.postMessage({event:"videopress_token_received",guid:s.guid,jwt:o.data.jwt},"*"):e.source.postMessage({event:"videopress_token_error",guid:s.guid},"*")}))}));