// File: embed-script.js // Function to find and append the embed code to the parent element function createEmbed() { // Find the parent element based on its id var parentContainer = document.getElementById('FGcQJ9mdFYGF'); if (parentContainer) { // Create and append the style element var styleElement = document.createElement('style'); styleElement.textContent = ` .h_iframe-mediacast_embed_frame { position: relative; margin:auto; } .h_iframe-mediacast_embed_frame .ratio { display: block; width: 100%; height: auto; } .h_iframe-mediacast_embed_frame iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0; border-radius:7px; overflow:hidden; } `; // Append the style element to the head parentContainer.appendChild(styleElement); // Create and append the embed code var embedContainer = document.createElement('div'); embedContainer.className = 'h_iframe-mediacast_embed_frame'; var spanElement = document.createElement('div'); spanElement.style.display = 'block'; spanElement.style.paddingTop = '56.25%'; var iframeElement = document.createElement('iframe'); iframeElement.src = 'https://mediacast.ir/v/s/9ccba558-433c-4931-a441-97869dd57ef5/gJycwbPPvC6x8ZqbxTYfsNt9f4v9jc2f?signature=007d70a69d48302a93490c3e1c6f405a6f8f2cdf92c06410729ceb7b34ad221a'; iframeElement.setAttribute('title', 'آبله میمون'); iframeElement.setAttribute('allowFullScreen', true); iframeElement.setAttribute('webkitallowfullscreen', true); iframeElement.setAttribute('mozallowfullscreen', true); embedContainer.appendChild(spanElement); embedContainer.appendChild(iframeElement); // Append the embed code to the found parent element parentContainer.appendChild(embedContainer); } } // Call the function to create the embed code when the page is fully loaded window.addEventListener('load', createEmbed);