| @@ 1215-1248 (lines=34) @@ | ||
| 1212 | $response['exif'] = $metadata; | |
| 1213 | } | |
| 1214 | ||
| 1215 | 		if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) { | |
| 1216 | $metadata = wp_get_attachment_metadata( $media_item->ID ); | |
| 1217 | 			if ( isset( $metadata['height'], $metadata['width'] ) ) { | |
| 1218 | $response['height'] = $metadata['height']; | |
| 1219 | $response['width'] = $metadata['width']; | |
| 1220 | } | |
| 1221 | ||
| 1222 | 			if ( isset( $metadata['length'] ) ) { | |
| 1223 | $response['length'] = $metadata['length']; | |
| 1224 | } | |
| 1225 | ||
| 1226 | // add VideoPress info | |
| 1227 | 			if ( function_exists( 'video_get_info_by_blogpostid' ) ) { | |
| 1228 | $info = video_get_info_by_blogpostid( $this->api->get_blog_id_for_output(), $media_id ); | |
| 1229 | ||
| 1230 | // Thumbnails | |
| 1231 | 				if ( function_exists( 'video_format_done' ) && function_exists( 'video_image_url_by_guid' ) ) { | |
| 1232 | $response['thumbnails'] = array( 'fmt_hd' => '', 'fmt_dvd' => '', 'fmt_std' => '' ); | |
| 1233 | 					foreach ( $response['thumbnails'] as $size => $thumbnail_url ) { | |
| 1234 | 						if ( video_format_done( $info, $size ) ) { | |
| 1235 | $response['thumbnails'][ $size ] = video_image_url_by_guid( $info->guid, $size ); | |
| 1236 | 						} else { | |
| 1237 | unset( $response['thumbnails'][ $size ] ); | |
| 1238 | } | |
| 1239 | } | |
| 1240 | } | |
| 1241 | ||
| 1242 | $response['videopress_guid'] = $info->guid; | |
| 1243 | $response['videopress_processing_done'] = true; | |
| 1244 | 				if ( '0000-00-00 00:00:00' == $info->finish_date_gmt ) { | |
| 1245 | $response['videopress_processing_done'] = false; | |
| 1246 | } | |
| 1247 | } | |
| 1248 | } | |
| 1249 | ||
| 1250 | $response['thumbnails'] = (object) $response['thumbnails']; | |
| 1251 | ||
| @@ 592-625 (lines=34) @@ | ||
| 589 | $response['exif'] = $metadata; | |
| 590 | } | |
| 591 | ||
| 592 | 		if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) { | |
| 593 | $metadata = wp_get_attachment_metadata( $media_item->ID ); | |
| 594 | 			if ( isset( $metadata['height'], $metadata['width'] ) ) { | |
| 595 | $response['height'] = $metadata['height']; | |
| 596 | $response['width'] = $metadata['width']; | |
| 597 | } | |
| 598 | ||
| 599 | 			if ( isset( $metadata['length'] ) ) { | |
| 600 | $response['length'] = $metadata['length']; | |
| 601 | } | |
| 602 | ||
| 603 | // add VideoPress info | |
| 604 | 			if ( function_exists( 'video_get_info_by_blogpostid' ) ) { | |
| 605 | $info = video_get_info_by_blogpostid( $this->site->blog_id, $media_id ); | |
| 606 | ||
| 607 | // Thumbnails | |
| 608 | 				if ( function_exists( 'video_format_done' ) && function_exists( 'video_image_url_by_guid' ) ) { | |
| 609 | $response['thumbnails'] = array( 'fmt_hd' => '', 'fmt_dvd' => '', 'fmt_std' => '' ); | |
| 610 | 					foreach ( $response['thumbnails'] as $size => $thumbnail_url ) { | |
| 611 | 						if ( video_format_done( $info, $size ) ) { | |
| 612 | $response['thumbnails'][ $size ] = video_image_url_by_guid( $info->guid, $size ); | |
| 613 | 						} else { | |
| 614 | unset( $response['thumbnails'][ $size ] ); | |
| 615 | } | |
| 616 | } | |
| 617 | } | |
| 618 | ||
| 619 | $response['videopress_guid'] = $info->guid; | |
| 620 | $response['videopress_processing_done'] = true; | |
| 621 | 				if ( '0000-00-00 00:00:00' == $info->finish_date_gmt ) { | |
| 622 | $response['videopress_processing_done'] = false; | |
| 623 | } | |
| 624 | } | |
| 625 | } | |
| 626 | ||
| 627 | $response['thumbnails'] = (object) $response['thumbnails']; | |
| 628 | ||