Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1206761

    Hello,
    how are you?
    On my website I want to prevent self-hosted mp4 Videos from looping. Unfortunately my webmaster skills are not sufficient enough to follow the steps described here. What excactly do I have to do? Thank you very much in advance for your assistance!

    Best regards!

    #1207247

    Hey ClimbingSocks,

    These are the step you gave to follow from the thread above to stop the video form looping in the video element:

    Best regards,
    Victoria

    #1207530

    Hello Victoria,
    thank you for your reply. I have already been aware of the link you posted and even referred to that link in my first post from 04/24/2020. My problem is that I don’t know how to access and edit the files section.php and functions.php of my child theme. These are the two files, which I am supposed to change, right? But how can I access and edit these two files?
    The problem I face is that I can’t find the editor under appearance. Under appearance I can only find themes, customizer, widgets and menus. There is no editor I could edit the files section.php and functions.php with.
    Thank you very much in advance for further assistance.

    Best regards!

    • This reply was modified 4 years, 7 months ago by ClimbingSocks.
    #1208248

    Hi ClimbingSocks,

    You can edit the files via the FTP, cPanel, or check if you have a plugin that is hiding the Appearance > Editor hidden, normally it’s some security plugin.

    Best regards,
    Victoria

    #1208327

    Hi Victoria,
    today I tried the following steps:

    • copy enfold/config-templatebuilder/avia-shortcodes/section.php file into enfold-child/shortcodes/ folder
    • open section.php in child theme and find
      'video_loop' => true,
      and change it to
      'video_loop' => false,
    • open functions.php in child theme and add following code:
      add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
      function avia_include_shortcode_template($paths)
      {
        $template_url = get_stylesheet_directory();
            array_unshift($paths, $template_url.'/shortcodes/');
      
        return $paths;
      }

    Unfortunately after these changes the website was down and showed a fatal error. So I removed the code from the last step as I realized that a similar code existed already in section.php which was:

    function avia_include_shortcode_template($paths)
    {
      $template_url = get_stylesheet_directory();
          array_unshift($paths, $template_url.'/shortcodes/');
    
      return $paths;
    }
    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);

    Now the website works again, but the videos are still looping!
    How can I change the videos from looping? Please provide further assistance! Thank you!

    • This reply was modified 4 years, 7 months ago by ClimbingSocks.
    #1209985

    Hi,

    Thank you for the update.

    You should create a new folder in the child theme directory and name it “shortcodes”, then create a copy of the section.php file inside. You don’t need to replicate the actual path of the shortcode in the parent theme.

    Best regards,
    Ismael

    #1217863

    Hello,

    sorry for asking again, but I am still struggling to stop my self hosted, embedded videos using the media element from the avia page builder from looping. Could you please provide me with a step by step guide on how to prevent videos from looping?
    Why is it so complicated?

    Thank you very much,
    Magnus

    #1218090

    Hi,
    It seems the login above is not working, please check. Which page are you testing on, the only video I could find was on the home page and was from Vimeo.

    Best regards,
    Mike

    #1218094

    Hi Mike,
    sorry. Meanwhile I changed the permalink of the article. I posted again the login details into the private content of this post.
    Many thanks,
    Magnus

    #1218101

    Hi,
    Please see below.

    Best regards,
    Mike

    #1218103

    Sorry. My fault. Please see private content again.

    Thank you so much for further assistance!

    #1218169

    Hi,
    Thanks for the login, I was hoping to check your child theme structure and modified files, but your WordPress > Appearance > Editor is disabled, probably in your wp-config.php there is this code define('DISALLOW_FILE_EDIT',true); if you are able to restore the theme editor or if you include FTP access we will be able to investigate further.

    Best regards,
    Mike

    #1218722

    Hello Mike,
    thank you for your further support. As I am somehow unexperienced with child-themes and changing the code of wordpress files, please find the FTP login credentials in the private content.

    Thank you very much for futher held.

    Best regards,
    Magnus

    #1218762

    Hi,
    Thank you for the FTP access, I changed the define('DISALLOW_FILE_EDIT',true); to define('DISALLOW_FILE_EDIT',false); in your wp-config.php so the WordPress > Appearance > Editor would show. I found your child theme section.php was empty, I added the correct code, but then realized that the video you were pointing to was in a video element so I copied the Video directory from Enfold shortcodes to your child theme an then in video.php changed line 347 from: $video_html_raw = avia_html5_video_embed( $src, $fallback_img ); to:

    $types = array('webm' => 'type="video/webm"', 'mp4' => 'type="video/mp4"', 'ogv' => 'type="video/ogg"');
    $attributes = array('autoplay' => 0, 'loop' => 0, 'preload' => ''  );
    $video_html_raw = avia_html5_video_embed($src, $fallback_img, $types, $attributes);

    and now your video only plays once. Please clear your browser cache and check.

    Best regards,
    Mike

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.