• Suggestion to replace Youtube IFRAME
    I added a filter to replace Youtube IFRAME by the PLYR player.

        // Iframe and find Autoplay
        $YTiframe = '/<iframe.*?(width="[0-9]*")?\.?(height="[0-9]*")?\.*?src=".*?youtube\.com\/embed\/(\w*\-?\w*).(autoplay=1)?.*?<\/iframe>/i';
        
        $YTreplace = '<div data-type="youtube" data-video-id="$3">';
        
        $content = preg_replace(
            $YTiframe, $YTreplace, $content
        );

    This search and find all Youtube iframe in post content and replace it by the PLYR plater

  • The topic ‘Suggestion to replace Youtube IFRAME’ is closed to new replies.