Okay
  Public Ticket #3024321
Video background looping
Closed

Comments

  •  1
    Vincent started the conversation

    Hello,


    I'm trying to have my video not looping. I'm using a background video on a row with content inside and the video is hosted on youtube. Could you help ? :)


    Thank you !

  •  1,877
    Judith replied

    Hi There,

    Thanks for choosing Salient.

    I am afraid looping is enabled by default on background video and so it may not be possible to stop the looping

    Thanks.

  •  1
    Vincent replied

    So there's no way to change that behaviour ? Even by modifying your code ? If it can be done by changing some of your code could you tell us where to look ?

  •  1,877
    Judith replied

    Hi There,

    You're going to need to copy the vc_row.php file into your child theme for overriding it and then modify this section: (around line 670)

    echo '<video class="nectar-video-bg" width="1800" height="700" preload="auto" loop="" autoplay="" muted="" playsinline="">';
    if(!empty($video_webm)) { echo '<source src="'. esc_url( $video_webm ) .'" type="video/webm">'; }
    if(!empty($video_mp4)) { echo '<source src="'. esc_url( $video_mp4 ) .'" type="video/mp4">'; }
    if(!empty($video_ogv)) { echo '<source src="'. esc_url( $video_ogv ) .'" type="video/ogg">'; }
    echo '</video>';
    

    to be this instead:

    echo '<video class="nectar-video-bg" width="1800" height="700" preload="auto" autoplay="" muted="" playsinline="">';
    if(!empty($video_webm)) { echo '<source src="'. esc_url( $video_webm ) .'" type="video/webm">'; }
    if(!empty($video_mp4)) { echo '<source src="'. esc_url( $video_mp4 ) .'" type="video/mp4">'; }
    if(!empty($video_ogv)) { echo '<source src="'. esc_url( $video_ogv ) .'" type="video/ogg">'; }
    echo '</video>';
    

    You can find it in here: "wp-content/plugins/salient-core/includes/vc_templates "

    Salient element overrides

    Salient allows for easy overriding of Salient WPBakery element template files through a child theme.

    • Step 1. Copy the desired template file from the salient-core plugin template directory (wp-content/plugins/salient-core/includes/vc_templates)
    • Step 2. Create a folder in the root of your child theme called “vc_templates” (salient-child/vc_templates)
    • Step 3. Paste the desired template file(s) inside that directory. Any template files found in that directory will be loaded instead of the default salient-core file.


    Kind regards,