: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
.progress-bar-container {
background: #d41556b5 !important;
text-transform: capitalize;
[data-sponsored-id] .hidden,
display: none !important;
/* Specific Styles for Ad Type 1 */
[data-sponsored-id="ep-ad-preview-0"] .main-ad-template {
[data-sponsored-id="ep-ad-preview-0"] .main-ad-template.image.ad-running {
/* Specific Styles for Ad Type 2 */
[data-sponsored-id="ep-ad-preview-1"] .main-ad-template {
[data-sponsored-id="ep-ad-preview-1"] .main-ad-template.image.ad-running {
height: 200px !important;
/* display: none !important; */
.position-right-wraper.gutenberg-pdf-wraper iframe {
p.embedpress-el-powered {
/* background: #fbebed; */
border-left: 4px solid #fe8c59;
border: 1px solid #faf4f4;
span.dashicons.dashicons-warning {
@media only screen and (max-width: 1540px) {
.ad__adjust__controller__item {
.video-ad-prewiew-options .form-input-wrapper {
.video-ad-prewiew-options .form-input-wrapper::-webkit-scrollbar {
.video-ad-prewiew-options .form-input-wrapper::-webkit-scrollbar-track {
.video-ad-prewiew-options .form-input-wrapper::-webkit-scrollbar-thumb {
.template__wrapper input[type=range] {
form#ad-preview-0 .form-input-wrapper {
max-height: 400px !important;
@media only screen and (max-width: 1440px) {
.embedpress-gutenberg-wrapper {
.video-ad-prewiew-options {
@media screen and (max-width: 1250px) {
flex-direction: column-reverse;
.video-ad-prewiew-options {
.embedpress-gutenberg-wrapper {
p.ads-settings-description {
@media screen and (max-width: 991px) {
// Check if data-playerid attribute exists and get its value
const isPyr = document.querySelector('[data-playerid]')?.getAttribute('data-playerid');
var scriptUrl = 'https://www.youtube.com/s/player/9d15588c/www-widgetapi.vflset/www-widgetapi.js';
var ttPolicy = window.trustedTypes.createPolicy("youtube-widget-api", {
createScriptURL: function(x) {
scriptUrl = ttPolicy.createScriptURL(scriptUrl);
if (!window["YT"]) YT = { loading: 0, loaded: 0 };
if (!window["YTConfig"]) YTConfig = { "host": "https://www.youtube.com" };
window.onYTReady = function() {
for (; i < l.length; i++) try {
YT.setConfig = function(c) {
if (c.hasOwnProperty(k)) YTConfig[k] = c[k];
var a = document.createElement("script");
a.type = "text/javascript";
a.id = "www-widgetapi-script";
var c = document.currentScript;
var n = c.nonce || c.getAttribute("nonce");
if (n) a.setAttribute("nonce", n);
var b = document.getElementsByTagName("script")[0];
b.parentNode.insertBefore(a, b);
let adsContainers = document.querySelectorAll('[data-sponsored-id]');
let container = document.querySelector('[data-sponsored-id]');
adsContainers = Array.from(adsContainers);
const getYTVideoId = (url) => {
// Check if the input is a string
if (typeof url !== 'string') {
const regex = /(?:youtube\.com\/(?:[^\/]+\/[^\/]+\/|(?:v|e(?:mbed)?)\/|[^#]*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/;
const match = url.match(regex);
const hasParentClass = (element, className) => {
var parent = element.parentNode;
while (parent && !(parent.classList && parent.classList.contains(className))) {
parent = parent.parentNode;
return !!(parent && parent.classList && parent.classList.contains(className));
const adInitialization = (adContainer, index, adAtts, adType) => {
const blockId = adAtts.clientId;
const blockIdMD5 = adContainer.getAttribute('data-sponsored-id');
const adStartAfter = adAtts.adStart * 1000;
const adContent = adAtts.adContent;
const adVideo = adContainer.querySelector('.ep-ad');
const adSource = adAtts.adSource;
const srcUrl = adAtts.url || adAtts.embedpress_embeded_link;
const adSkipButtonAfter = parseInt(adAtts.adSkipButtonAfter);
const adSkipButton = adAtts.adSkipButton;
const adUrl = adAtts.adUrl;
const adTemplate = adContainer.querySelector('.main-ad-template');
const imageAdTemplate = adContainer.querySelector('.main-ad-template.image');
const progressBar = adContainer.querySelector('.progress-bar');
const skipButton = adTemplate.querySelector('.skip-ad-button');
const adRunningTime = adContainer.querySelector('.ad-running-time');
const adMask = adContainer;
let playbackInitiated = false;
if (skipButton && adSource !== 'video') {
skipButton.style.display = 'inline-block';
const hashClass = hasParentClass(adContainer, 'ep-content-protection-enabled');
adContainer.classList.remove('ad-mask');
playerId = adContainer.querySelector('[data-playerid]')?.getAttribute('data-playerid');
if (getYTVideoId(srcUrl)) {
player[index]?.playVideo();
player[index]?.seekTo(0);
adTemplate.classList.remove('image', 'video');
adTemplate.classList.add(adType);
if (adType === 'image' && adUrl) {
adTemplate.querySelector('.ad-image .ad-url')?.setAttribute('href', adUrl);
adTemplate.querySelector('.ad-video .ad-url')?.setAttribute('href', adUrl);
if (!playbackInitiated) {
adTimeout = setTimeout(() => {
if (adSource !== 'image') {
adContainer.querySelector('.ep-embed-content-wraper').classList.add('hidden');
adTemplate?.classList.add('ad-running');
adTemplate?.classList.remove('hidden');
if (adVideo && adSource === 'video') {
adTemplate.querySelector('.ad-video').classList.remove('hidden');
adTemplate.querySelector('.ad-image').classList.add('hidden');
if (adType === 'image') {
adTemplate.querySelector('.ad-image').classList.remove('hidden');
adTemplate.querySelector('.ad-video').classList.add('hidden');
playbackInitiated = true;
adContainer.classList.remove('ad-mask');
adVideo?.addEventListener('timeupdate', () => {
const currentTime = adVideo?.currentTime;
const videoDuration = adVideo?.duration;
if (currentTime <= videoDuration) {
const remainingTime = Math.max(0, videoDuration - currentTime); // Ensure it's not negative
adRunningTime.innerText = Math.floor(remainingTime / 60) + ':' + (Math.floor(remainingTime) % 60).toString().padStart(2, '0');
if (!isNaN(currentTime) && !isNaN(videoDuration)) {
const progress = (currentTime / videoDuration) * 100;
progressBar.style.width = progress + '%';
if (adSkipButton && currentTime >= adSkipButtonAfter) {
skipButton.style.display = 'inline-block';
skipButton.style.display = 'none';
document?.addEventListener('click', (event) => {
if (event.target.classList.contains('skip-ad-button')) {
adTemplate?.classList.remove('ad-running');
document.querySelector('.preview-btn-' + index).innerText = 'Play Preview';
document.querySelector('.preview-btn-' + index).removeAttribute('disabled');
if (getYTVideoId(srcUrl)) {
player[index]?.playVideo();
adTemplate.querySelector('.ad-video').classList.add('hidden');
adTemplate.querySelector('.ad-image').classList.add('hidden');
adContainer.querySelector('.ep-embed-content-wraper').classList.remove('hidden');
adVideo?.addEventListener('play', () => {
if (typeof playerInit !== 'undefined' && playerInit.length > 0) {
playerInit[playerId]?.stop();
adVideo?.addEventListener('ended', () => {
adTemplate.classList.add('hidden');
adContainer.querySelector('.ep-embed-content-wraper').classList.remove('hidden');
document.querySelector('.preview-btn-' + index).innerText = 'Play Preview';
document.querySelector('.preview-btn-' + index).removeAttribute('disabled');
function onYouTubeIframeAPIReady(iframe, srcUrl, adVideo, index) {
if (iframe && getYTVideoId(srcUrl) !== null) {
player[index] = new YT.Player(iframe, {
videoId: getYTVideoId(srcUrl),
'onReady': (event) => onPlayerReady(event, adVideo),
function onPlayerReady(event, adVideo) {
adVideo?.addEventListener('ended', function() {
event.target.playVideo();
adVideo?.addEventListener('play', function() {
event.target.pauseVideo();
event.target.g.style = 'opacity: 1';
window.onload = function() {
let yVideos = setInterval(() => {
var youtubeVideos = document.querySelectorAll('.ose-youtube');
if (youtubeVideos.length > 0) {
youtubeVideos.forEach((yVideo, index) => {
const srcUrl = yVideo.querySelector('iframe')?.getAttribute('src');
const adVideo = yVideo.closest('.ad-mask')?.querySelector('.ep-ad');
const isYTChannel = yVideo.closest('.ad-mask')?.querySelector('.ep-youtube-channel');