Currently loading videos during a page load increases load time. It would be great if there was an option to lazy load in the these videos after the page is loaded. End results would be an increased page speed.

Comments

duckx created an issue. See original summary.

patoshi’s picture

I updated the oembed.tpl.php with a preg_replace() to add in an extra youtube parameter that loads the youtube related js files only when you click on play.

More info here: http://drupal.stackexchange.com/questions/201632/drupal-7-oembed-video-m...

I'm sure there is a better way of doing this instead of doing a preg_replace()

  1 <?php
  2 /**  
  3  * @file
  4  * Default template file for oembed data
  5  */  
  6 ?>   
  7 <div class="<?php print $classes; ?>"<?php print $attributes; ?>>
  8      
  9   <?php print render($title_prefix); ?>
 10   <?php if ($title): ?>
 11     <a href="<?php print $original_url; ?>"<?php print $title_attributes; ?>><?php print render($title); ?></a>
 12   <?php endif; ?>
 13   <?php print render($title_suffix); ?>
 14      
 15   <span<?php print $content_attributes; ?>>
 16     <?php
 17     $content = preg_replace('/feature=oembed/', 'feature=oembed&controls=2&modestbranding=1', $content);                                                                                                                                                          
 18     print render($content); ?>
 19   </span>
 20 </div>
~                                                                                                                                                                                                                                                                     
~              
astonvictor’s picture

Status: Active » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.