videopress_is_finished_processing

Check to see if a video has completed processing.

Description

videopress_is_finished_processing( (int) $post_id ); 

Parameters (1)

0. $post_id (int)
The post id.

Usage

  1. if ( !function_exists( 'videopress_is_finished_processing' ) ) { 
  2. require_once '/modules/videopress/utility-functions.php'; 
  3.  
  4. // The post id. 
  5. $post_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = videopress_is_finished_processing($post_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/modules/videopress/utility-functions.php  
  1. function videopress_is_finished_processing( $post_id ) { 
  2. $post = get_post( $post_id ); 
  3.  
  4. if ( is_wp_error( $post ) ) { 
  5. return false; 
  6.  
  7. $meta = wp_get_attachment_metadata( $post->ID ); 
  8.  
  9. if ( ! isset( $meta['file_statuses'] ) || ! is_array( $meta['file_statuses'] ) ) { 
  10. return false; 
  11.  
  12. $check_statuses = array( 'hd', 'dvd', 'mp4', 'ogg' ); 
  13.  
  14. foreach ( $check_statuses as $status ) { 
  15. if ( ! isset( $meta['file_statuses'][ $status ] ) || $meta['file_statuses'][ $status ] != 'DONE' ) { 
  16. return false; 
  17.  
  18. return true;