0 && $metadata['height'] > 0 )
) {
return $content;
}
// Locate the VIDEO tag to add the dimensions.
$p = new WP_HTML_Tag_Processor( $content );
if ( ! $p->next_tag( array( 'tag_name' => 'VIDEO' ) ) ) {
return $content;
}
$p->set_attribute( 'width', (string) $metadata['width'] );
$p->set_attribute( 'height', (string) $metadata['height'] );
/*
* The aspect-ratio style is needed due to an issue with the CSS spec: