Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ public function print_video_scripts() {
cld.videoPlayer( cldId, cldConfig );
}

<?php if ( $this->config['video_freeform'] ): ?>
window.addEventListener( 'load', function() {
for ( var videoInstance in cldVideos ) {
var cldId = 'cloudinary-video-' + videoInstance;
Expand All @@ -370,16 +369,18 @@ public function print_video_scripts() {

if ( videoElement.length === 1 ) {
videoElement = videoElement[0];
videoElement.style.width = '100%';

<?php if ( $this->config['video_freeform'] ): ?>
videoElement.src = videoElement.src.replace(
'upload/',
'upload/<?php echo esc_js( $this->config['video_freeform'] ) ?>/'
);
<?php endif ?>
}
}
} );
<?php
endif;

<?php
$script = ob_get_clean();

wp_add_inline_script(
Expand Down