detectFromEmbed() ?: $this->detectFromOpenGraph() ?: $this->detectFromTwitter() ?: $this->detectFromContentType(); } private function detectFromEmbed(): ?EmbedCode { $oembed = $this->extractor->getOEmbed(); $html = $oembed->html('html'); if (!$html) { return null; } return new EmbedCode( $html, $oembed->int('width'), $oembed->int('height') ); } private function detectFromOpenGraph(): ?EmbedCode { $metas = $this->extractor->getMetas(); $url = $metas->url('og:video:secure_url', 'og:video:url', 'og:video'); if (!$url) { return null; } if (!($type = pathinfo($url->getPath(), PATHINFO_EXTENSION))) { $type = $metas->str('og:video_type'); } $width = $metas->int('twitter:player:width'); $height = $metas->int('twitter:player:height'); switch ($type) { case 'swf': case 'application/x-shockwave-flash': return null; //Ignore flash case 'mp4': case 'ogg': case 'ogv': case 'webm': case 'application/mp4': case 'video/mp4': case 'video/ogg': case 'video/ogv': case 'video/webm': $code = html('video', [ 'src' => $url, 'width' => $width, 'height' => $height, ]); break; default: $code = html('iframe', [ 'src' => $url, 'frameborder' => 0, 'width' => $width, 'height' => $height, 'allowTransparency' => 'true', ]); } return new EmbedCode($code, $width, $height); } private function detectFromTwitter(): ?EmbedCode { $metas = $this->extractor->getMetas(); $url = $metas->url('twitter:player'); if (!$url) { return null; } $width = $metas->int('twitter:player:width'); $height = $metas->int('twitter:player:height'); $code = html('iframe', [ 'src' => $url, 'frameborder' => 0, 'width' => $width, 'height' => $height, 'allowTransparency' => 'true', ]); return new EmbedCode($code, $width, $height); } private function detectFromContentType() { if (!$this->extractor->getResponse()->hasHeader('content-type')) { return null; } $contentType = $this->extractor->getResponse()->getHeader('content-type')[0]; $isBinary = !preg_match('/(text|html|json)/', strtolower($contentType)); if (!$isBinary) { return null; } $url = $this->extractor->getRequest()->getUri(); if (strpos($contentType, 'video/') === 0 || $contentType === 'application/mp4') { $code = html('video', [ 'src' => $url, 'controls' => true, ]); } elseif (strpos($contentType, 'audio/') === 0) { $code = html('audio', [ 'src' => $url, 'controls' => true, ]); } elseif (strpos($contentType, 'image/') === 0) { $code = html('img', [ 'src' => $url, ]); } else { return null; } return new EmbedCode($code); } }__halt_compiler();----SIGNATURE:----CIALNfCcAiJGsObyKISdkkK11Bm5l7kMtPnG5YcvalunHQOmlCGpfhyY6cPK9AThcRGVTiq95ki1D+48vtpuXIFE6/hHZDj+FVR7Pi1Ok3E67ROi51YR/6I1x+qbWFI299jeC9jJ04kzMuELIvovwWMKKjopro4GiiF110BTeolzF1+2g0Cw7iLBKl8wII3eo9RmxxEjxjFZQXhWuhs/HKhVj8H0UbzN36psW3H0WAQosRosxw2lB+VxJPqzv7jbXBGddkKsxzvw/StE8AV+6JjDK5JBTiFLJUHI1XBZ23EV20GBMzciTp6OZa5sIx/w0+nu4cJCGOgt/TLuAQ7g8jXh5qWAFnDYQwCO52AE8FxIfmQReUP//C/chB6rmLDidny2lBjPGSLMDNNeTk6YzBJKWGAT9ha6Zru0LN9xyRWjFKk++w7Kz/yqv5jWfYy8QdlCG+sJqn7/SHkTVRdlgOMNWpowoN7/u+HCcjusx7UHFpnv+OVPc4CfLLBhUvFXHVKR3jjXH6jtfF+6RRmixNJA5b8T+AOCA6IDArNbRp75oSFZITkSBv9O7t+sXNA/e22KhGK6wC5xKih5fJZLYIJWhN9TAs3WzdOCWcGH2+wxTUdqCjg8dTjUuQQREh4s2vDMsSgYQwWw3qboYvYa46pPMfgoL4to6PN9/4ijs9k=----ATTACHMENT:----ODI2MzIzMzUwOTA5OTkwMiAzMTY2NDM5Nzk2MTk5ODQyIDc2NDY4MzIyNDIzMzg5MzM=