From a09ec0c3ca6f81d73d10021c63eb92fbfdb804dc Mon Sep 17 00:00:00 2001 From: Tremi Dkhar Date: Fri, 19 Mar 2021 16:42:54 +0530 Subject: [PATCH 1/3] Fix where an error is displayed when the video is undergo transcoding --- admin/rt-transcoder-functions.php | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/admin/rt-transcoder-functions.php b/admin/rt-transcoder-functions.php index ce6f39bf..45bbf40f 100755 --- a/admin/rt-transcoder-functions.php +++ b/admin/rt-transcoder-functions.php @@ -935,42 +935,26 @@ function rtt_add_transcoding_process_status_button_single_media_page( $rtmedia_i add_action( 'rtmedia_actions_before_description', 'rtt_add_transcoding_process_status_button_single_media_page', 10, 1 ); /** - * To resize video container of media single page when video is being transcoded . - * - * @since 1.2 + * Do not show the video if it is undergos transcoding. * * @param string $html html markup. * @param object $rtmedia_media rtmedia media object. * * @return string html markup */ -function rtt_filter_single_media_page_video_markup( $html, $rtmedia_media ) { +function rtt_filter_no_video_on_transcoding( $html, $rtmedia_media ) { if ( empty( $rtmedia_media ) || empty( $rtmedia_media->media_type ) || empty( $rtmedia_media->media_id ) ) { return $html; } if ( 'video' === $rtmedia_media->media_type && is_file_being_transcoded( $rtmedia_media->media_id ) ) { - $youtube_url = get_rtmedia_meta( $rtmedia_media->id, 'video_url_uploaded_from' ); - $html = "
"; - - if ( empty( $youtube_url ) ) { - - $html_video = ''; - $html .= sprintf( $html_video, esc_url( $rtmedia_media->cover_art ), esc_url( wp_get_attachment_url( $rtmedia_media->media_id ) ), esc_attr( $rtmedia_media->id ) ); - - } else { - - $html_video = ''; - $html .= sprintf( $html_video, esc_attr( $rtmedia_media->id ), esc_url( wp_get_attachment_url( $rtmedia_media->media_id ) ) ); - - } - - $html .= '
'; + $html = '

' . esc_html__( 'This video is being transcoded. Please wait.', 'transcoder' ) . '

'; } + return $html; } -add_filter( 'rtmedia_single_content_filter', 'rtt_filter_single_media_page_video_markup', 10, 2 ); +add_filter( 'rtmedia_single_content_filter', 'rtt_filter_no_video_on_transcoding', 10, 2 ); /** * From a2c7600e844d4d59b7e994f4b0821f9881827b93 Mon Sep 17 00:00:00 2001 From: Tremi Dkhar Date: Wed, 24 Mar 2021 21:50:19 +0530 Subject: [PATCH 2/3] Update admin/rt-transcoder-functions.php Co-authored-by: Siddharth Tikekar --- admin/rt-transcoder-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/rt-transcoder-functions.php b/admin/rt-transcoder-functions.php index 45bbf40f..25ac646c 100755 --- a/admin/rt-transcoder-functions.php +++ b/admin/rt-transcoder-functions.php @@ -935,7 +935,7 @@ function rtt_add_transcoding_process_status_button_single_media_page( $rtmedia_i add_action( 'rtmedia_actions_before_description', 'rtt_add_transcoding_process_status_button_single_media_page', 10, 1 ); /** - * Do not show the video if it is undergos transcoding. + * Do not render