1152 | | $type = wp_check_filetype( $src, wp_get_mime_types() ); |
1153 | | if ( ! in_array( strtolower( $type['ext'] ), $default_types ) ) |
1154 | | return sprintf( '<a class="wp-embedded-video" href="%s">%s</a>', esc_url( $src ), esc_html( $src ) ); |
| 1154 | if ( ! preg_match( $yt_pattern, $src ) ) { |
| 1155 | $type = wp_check_filetype( $src, wp_get_mime_types() ); |
| 1156 | if ( ! in_array( strtolower( $type['ext'] ), $default_types ) ) { |
| 1157 | return sprintf( '<a class="wp-embedded-video" href="%s">%s</a>', esc_url( $src ), esc_html( $src ) ); |
| 1158 | } |
| 1159 | } |
1219 | | $type = wp_check_filetype( $$fallback, wp_get_mime_types() ); |
1220 | | // m4v sometimes shows up as video/mpeg which collides with mp4 |
1221 | | if ( 'm4v' === $type['ext'] ) |
1222 | | $type['type'] = 'video/m4v'; |
| 1224 | |
| 1225 | if ( 'src' === $fallback && preg_match( $yt_pattern, $src ) ) { |
| 1226 | $type = array( 'type' => 'video/youtube' ); |
| 1227 | } else { |
| 1228 | $type = wp_check_filetype( $$fallback, wp_get_mime_types() ); |
| 1229 | // m4v sometimes shows up as video/mpeg which collides with mp4 |
| 1230 | if ( 'm4v' === $type['ext'] ) |
| 1231 | $type['type'] = 'video/m4v'; |
| 1232 | } |