| @@ 1383-1392 (lines=10) @@ | ||
| 1380 | } |
|
| 1381 | ||
| 1382 | // Thumbnails |
|
| 1383 | if ( function_exists( 'video_format_done' ) && function_exists( 'video_image_url_by_guid' ) ) { |
|
| 1384 | $response['thumbnails'] = array( 'fmt_hd' => '', 'fmt_dvd' => '', 'fmt_std' => '' ); |
|
| 1385 | foreach ( $response['thumbnails'] as $size => $thumbnail_url ) { |
|
| 1386 | if ( video_format_done( $info, $size ) ) { |
|
| 1387 | $response['thumbnails'][ $size ] = video_image_url_by_guid( $info->guid, $size ); |
|
| 1388 | } else { |
|
| 1389 | unset( $response['thumbnails'][ $size ] ); |
|
| 1390 | } |
|
| 1391 | } |
|
| 1392 | } |
|
| 1393 | ||
| 1394 | // If we didn't get VideoPress information (for some reason) then let's |
|
| 1395 | // not try and include it in the response. |
|
| @@ 640-649 (lines=10) @@ | ||
| 637 | $info = video_get_info_by_blogpostid( $this->site->get_id(), $media_id ); |
|
| 638 | ||
| 639 | // Thumbnails |
|
| 640 | if ( function_exists( 'video_format_done' ) && function_exists( 'video_image_url_by_guid' ) ) { |
|
| 641 | $response['thumbnails'] = array( 'fmt_hd' => '', 'fmt_dvd' => '', 'fmt_std' => '' ); |
|
| 642 | foreach ( $response['thumbnails'] as $size => $thumbnail_url ) { |
|
| 643 | if ( video_format_done( $info, $size ) ) { |
|
| 644 | $response['thumbnails'][ $size ] = video_image_url_by_guid( $info->guid, $size ); |
|
| 645 | } else { |
|
| 646 | unset( $response['thumbnails'][ $size ] ); |
|
| 647 | } |
|
| 648 | } |
|
| 649 | } |
|
| 650 | ||
| 651 | $response['videopress_guid'] = $info->guid; |
|
| 652 | $response['videopress_processing_done'] = true; |
|