diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php index c155f2e8..e42888ce 100755 --- a/admin/rt-transcoder-handler.php +++ b/admin/rt-transcoder-handler.php @@ -236,7 +236,7 @@ public function wp_media_transcoding( $wp_metadata, $attachment_id, $autoformat $job_type = 'video'; - if ( ( ! empty( $type_array ) && 'audio' === $type_array[0] ) || in_array( $extension, explode( ',', $this->audio_extensions ), true ) ) { + if ( ( ! empty( $type_array ) && ! empty( $type_array[0] ) && 'audio' === $type_array[0] ) || in_array( $extension, explode( ',', $this->audio_extensions ), true ) ) { $job_type = 'audio'; } elseif ( in_array( $extension, explode( ',', $this->other_extensions ), true ) ) { $job_type = $extension; @@ -267,7 +267,7 @@ public function wp_media_transcoding( $wp_metadata, $attachment_id, $autoformat 'file_url' => rawurlencode( $url ), 'callback_url' => rawurlencode( trailingslashit( home_url() ) . 'index.php' ), 'force' => 0, - 'formats' => ( true === $autoformat ) ? ( ( 'video' === $type_array[0] ) ? 'mp4' : 'mp3' ) : $autoformat, + 'formats' => ( true === $autoformat ) ? ( ( ! empty( $type_array[0] ) && 'video' === $type_array[0] ) ? 'mp4' : 'mp3' ) : $autoformat, 'thumb_count' => $options_video_thumb, ), );