host = $host; $host->add_hook($host::HOOK_RENDER_ENCLOSURE, $this); $host->add_hook($host::HOOK_IFRAME_WHITELISTED, $this); } function hook_iframe_whitelisted($src) { return in_array($src, ["www.youtube.com", "youtube.com", "www.youtube-nocookie.com", "youtube-nocookie.com", "youtu.be"]); } function hook_render_enclosure($entry, $hide_images) { $url = $entry["content_url"]; if ($vid_id = UrlHelper::url_to_youtube_vid($url)) { return "
"; } } function api_version() { return 2; } }