2

This seems like it should be simple, but: How do I make loop true on videos uploaded with D7's video module (HTML 5 Player)? The setting is no where on the front end, and when I dive into the module's theme options, 'loop' doesn't even seem to be a variable? The only variables seem to be:

 * $item
 * $width
 * $height
 * $autoplay
 * $autobuffering

Placing loop="true" inline would be the obvious option, but this also doesn't seem to be do-able via the D7 module.

1
3
+50

You could try to override this in your theme. The video module provides the video-play-html5.tpl.php file. You can copy this file to your active theme (copy it to all if your site supports more themes) and add the loop="true" setting to the following line:

<video width="<?php echo $width; ?>" height="<?php echo $height; ?>" preload="<?php echo $preload; ?>" controls="controls" poster="<?php echo $poster; ?>"<?php echo $autoplayattr; ?>>

Clear the cache to have Drupal detect your template override. That should make the video loop. However this would make every video always loop. If you need control per video, you will have to patch bigger portions of the module, add variables etc. It should be handled in the feature request instead. (It would be out of scope here.)

1
  • 3
    You are a genius - thank you!!! Will award bounty after the 18 hours is up!
    – Brittany
    Feb 16 '17 at 23:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.