| 227 | if ( preg_match( '#^audio#', $type ) ) { |
| 228 | $meta = wp_read_audio_metadata( $file ); |
| 229 | if ( ! empty( $meta['title'] ) ) |
| 230 | $title = $meta['title']; |
| 231 | |
| 232 | $content = trim( sprintf( |
| 233 | '%s%s%s.', |
| 234 | ! empty( $title ) ? '"' . $title . '"' : '', |
| 235 | ! empty( $meta['album'] ) ? ' from ' . $meta['album'] : '', |
| 236 | ! empty( $meta['artist'] ) ? ' by ' . $meta['artist'] : '' |
| 237 | ) ); |
| 238 | |
| 239 | if ( ! empty( $meta['year'] ) ) |
| 240 | $content .= sprintf( ' Released: %d.', $meta['year'] ); |
| 241 | |
| 242 | if ( ! empty( $meta['track_number'] ) ) { |
| 243 | list( $track, $length ) = explode( '/', $meta['track_number'] ); |
| 244 | $content .= sprintf( ' Track %d of %d.', $track, $length ); |
| 245 | } |
| 246 | |
| 247 | if ( ! empty( $meta['genre'] ) ) |
| 248 | $content .= sprintf( ' Genre: %s.', $meta['genre'] ); |
| 249 | |
| 250 | } elseif ( preg_match( '#^video#', $type ) ) { |
| 251 | $meta = wp_read_video_metadata( $file ); |
2393 | | <?php if ( $media_dims ) : ?> |
| 2425 | <?php |
| 2426 | if ( preg_match( '#^audio|video#', $post->post_mime_type ) ): |
| 2427 | |
| 2428 | if ( ! empty( $meta['mime_type'] ) ) : ?> |
| 2429 | <div class="misc-pub-section"> |
| 2430 | <?php _e( 'Mime-type:' ); ?> <strong><?php echo $meta['mime_type']; ?></strong> |
| 2431 | </div> |
| 2432 | <?php |
| 2433 | endif; |
| 2434 | |
| 2435 | if ( ! empty( $meta['bitrate'] ) ) : ?> |
| 2436 | <div class="misc-pub-section"> |
| 2437 | <?php _e( 'Bitrate:' ); ?> <strong><?php |
| 2438 | echo $meta['bitrate'] / 1000, 'kb/s'; |
| 2439 | |
| 2440 | if ( ! empty( $meta['bitrate_mode'] ) ) |
| 2441 | echo ' ', strtoupper( $meta['bitrate_mode'] ); |
| 2442 | |
| 2443 | ?></strong> |
| 2444 | </div> |
| 2445 | <?php |
| 2446 | endif; |
| 2447 | |
| 2448 | if ( ! empty( $meta['audio']['dataformat'] ) ) : ?> |
| 2449 | <div class="misc-pub-section"> |
| 2450 | <?php _e( 'Audio Format:' ); ?> <strong><?php echo $meta['audio']['dataformat']; ?></strong> |
| 2451 | </div> |
| 2452 | <?php |
| 2453 | endif; |
| 2454 | |
| 2455 | if ( ! empty( $meta['audio']['codec'] ) ) : ?> |
| 2456 | <div class="misc-pub-section"> |
| 2457 | <?php _e( 'Audio Codec:' ); ?> <strong><?php echo $meta['audio']['codec']; ?></strong> |
| 2458 | </div> |
| 2459 | <?php |
| 2460 | endif; |
| 2461 | |
| 2462 | if ( ! empty( $meta['year'] ) ) : ?> |
| 2463 | <div class="misc-pub-section"> |
| 2464 | <?php _e( 'Year:' ); ?> <strong><?php echo $meta['year']; ?></strong> |
| 2465 | </div> |
| 2466 | <?php |
| 2467 | endif; |
| 2468 | |
| 2469 | if ( ! empty( $meta['genre'] ) ) : ?> |
| 2470 | <div class="misc-pub-section"> |
| 2471 | <?php _e( 'Genre:' ); ?> <strong><?php echo $meta['genre']; ?></strong> |
| 2472 | </div> |
| 2473 | <?php |
| 2474 | endif; |
| 2475 | |
| 2476 | if ( ! empty( $meta['length_formatted'] ) ) : ?> |
| 2477 | <div class="misc-pub-section"> |
| 2478 | <?php _e( 'Length:' ); ?> <strong><?php echo $meta['length_formatted']; ?></strong> |
| 2479 | </div> |
| 2480 | <?php |
| 2481 | endif; |
| 2482 | |
| 2483 | endif; |
| 2484 | |
| 2485 | if ( $media_dims ) : ?> |