Skip to content

Commit

Permalink
fix(app): Add condition to enqueue script from transcoder
Browse files Browse the repository at this point in the history
Enqueue script only if rtMedia class is exists. This script add some UI changes to rtMedia component, when it is used with transcoder.
  • Loading branch information
Utsav-Ladani committed Oct 19, 2023
1 parent af373f5 commit a6d3576
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion admin/rt-transcoder-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ function rtt_enqueue_frontend_scripts() {
$file_to_use = 'public-assets/js/build/transcoder.min.js';

$file = path_join( RT_TRANSCODER_PATH, $file_to_use );
if ( file_exists( $file ) ) {
if ( file_exists( $file ) && class_exists( 'RTMedia' ) ) {
wp_enqueue_script( 'rt-transcoder-front-js', RT_TRANSCODER_URL . $file_to_use, array( 'jquery', 'rtmedia-backbone' ), filemtime( $file ), true );

$rest_url_prefix = get_site_url() . '/' . rest_get_url_prefix();
Expand Down

0 comments on commit a6d3576

Please sign in to comment.