Index: src/wp-includes/media.php
===================================================================
--- src/wp-includes/media.php	(revision 27052)
+++ src/wp-includes/media.php	(working copy)
@@ -1783,6 +1783,19 @@
 	else
 		list( $type, $subtype ) = array( $attachment->post_mime_type, '' );
 
+	// For audio/video, check for existence of meta_key when $meta is empty
+	if ( in_array( $type, array( 'audio', 'video' ) ) && empty( $meta ) ) {
+		$_meta = get_post_meta( $attachment->ID );
+		if ( ! array_key_exists( '_wp_attachment_metadata', $_meta ) ) {
+			// Regenerate the metadata if the file exists
+			$file = get_attached_file( $attachment->ID );
+			$meta = wp_generate_attachment_metadata( $attachment->ID, $file );
+			if ( file_exists( $file ) ) {
+				wp_update_attachment_metadata( $attachment->ID, $meta );
+			}
+		}
+	}
+
 	$attachment_url = wp_get_attachment_url( $attachment->ID );
 
 	$response = array(
