+ $videoNodes = $xpath->query("//video | //iframe | //object | //embed | //div[@data-facadesrc]");
+
+ foreach ($videoNodes as $node) {
+ // Decide which handler to call based on the tag name
+ $data = match ($node->nodeName) {
+ 'video' => $this->handleVideo($node),
+ 'iframe' => $this->handleIframe($node),
+ 'object' => $this->handleObject($node),
+ 'embed' => $this->handleEmbed($node),
+ 'div' => $this->handleDiv($node),
+ default => null,
+ };
+
+ // If we got valid data back, assemble the final info
+ if ($data !== null) {
+ $videos[] = [
+ 'type' => $data['type'],
+ 'html' => $node->ownerDocument->saveHTML($node),
+ 'src' => strtok($data['src'], '?'),
+ ];
+ }
+ }
+
+ return $videos;
+ }
+
+ /**
+ * Handle