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 @@ -369,29 +369,29 @@ public function print_video_scripts() {
var cldVideos = <?php echo wp_json_encode( $cld_videos ); ?>;

for ( var videoInstance in cldVideos ) {
var cldConfig = cldVideos[ videoInstance ];
var cldId = 'cloudinary-video-' + videoInstance;
cld.videoPlayer( cldId, cldConfig );
var cldConfig = cldVideos[ videoInstance ];
var cldId = 'cloudinary-video-' + videoInstance;
cld.videoPlayer( cldId, cldConfig );
}

window.addEventListener( 'load', function() {
for ( var videoInstance in cldVideos ) {
var cldId = 'cloudinary-video-' + videoInstance;
var videoContainer = document.getElementById( cldId );
var videoElement = videoContainer.getElementsByTagName( 'video' );

if ( videoElement.length === 1 ) {
videoElement = videoElement[0];


<?php if ( $this->config['video_freeform'] ): ?>
videoElement.src = videoElement.src.replace(
'upload/',
'upload/<?php echo esc_js( $this->config['video_freeform'] ) ?>/'
);
<?php endif ?>
}
}
for ( var videoInstance in cldVideos ) {
var cldId = 'cloudinary-video-' + videoInstance;
var videoContainer = document.getElementById( cldId );
var videoElement = videoContainer.getElementsByTagName( 'video' );

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
$script = ob_get_clean();
Expand Down