Hi,

The video in the homepage doesn't start automatically in Crhome, it is showed as youtube with anothers videos below but no works even click on start button.

This is the code of the style-4.php file:

<?php
$heroStyle = $helper->get('hero-style');
$heroTextPos = $helper->get('hero-content-position');
$heroTextAlign = $helper->get('hero-text-align');
$heroHeading = $helper->get('hero-heading');
$heroIntro = $helper->get('hero-intro');
$heroVideo = $helper->get('hero-video');
$heroScreen = $helper->get('hero-screen');


$video_src = '';
$video_link = '';
if ($heroVideo) {
$arr = preg_split ('/=/', $heroVideo, 2);
if (count($arr) == 2) {

switch (trim($arr[0])) {
case 'vimeo':
$video_src = '//player.vimeo.com/video/' . trim($arr[1]) . '?title=0&amp;byline=0&amp;portrait=0&amp;autoplay=1&amp;loop=1';
$video_link = trim($arr[1]);
break;
case 'youtube':
$video_src = '//www.youtube.com/embed/' . trim($arr[1]) . '?playlist=' . trim($arr[1]) . '&amp;autoplay=1&amp;loop=1&amp;html5=1';
$video_link = trim($arr[1]);
break;
default:
break;
}
}
}
?>

<div class="section-inner <?php echo $helper->get('block-extra-class'); ?>">
<div class="acm-hero style-4 <?php echo ($heroStyle .' '. $heroTextPos. ' '. $heroTextAlign.' '. $heroScreen); ?> <?php if( trim($heroHeading) ) echo ' show-intro'; ?>">
<div class="video-wrapper">
<?php if ($heroVideo) { ?>
<iframe frameborder="0" width="100%" height="100%" allowfullscreen="" mozallowfullscreen="" webkitallowfullscreen="" src="<?php echo $video_src ?>"></iframe>
<?php } ?>
<div class="container">
<div class="hero-content">
<?php if( trim($heroHeading)) : ?>
<div class="hero-heading">
<?php echo $heroHeading; ?>
</div>
<?php endif; ?>


      <?php if( trim($heroIntro)) : ?>
      <div class="hero-intro">
        <?php echo $heroIntro; ?>
      </div>
      <?php endif; ?>
  		
  		<?php if ($heroVideo) { ?>
      <div class="hero-btn-actions">
        <a href="http://vimeo.com/<?php echo $video_link; ?>" title="<?php if( trim($heroHeading)) : ?> <?php echo $heroHeading; ?> <?php endif; ?>" class="btn btn-border btn-border-inverse btn-rounded"><span class="sr-only">Watch the video</span><i class="fa fa-chevron-right"></i></a>
      </div>
      <?php } ?>
    </div>

  </div>
</div>

</div>
</div>
<script>
(function($){

$(document).ready(function(){
$('.hero-btn-actions .btn-border-inverse', '.style-4').unbind('click').click(function(e) {
  $(this).parents('.style-4:first').addClass('mask-off');
  e.preventDefault();
});

$( window ).scroll(function() {
		$('.style-4.mask-off').removeClass('mask-off');
	});

});

})(jQuery);
</script>

Many thanks Marco

    marco17 The relative issue has started to occur in Chrome due to reasons mentioned here in the redirection link

    You may try the code modifications as mentioned in specific file in aforesaid forum thread

    aman204 changed the title to The video in the home page no start automatically in Chrome.

    Hi aman204,

    many thanks for your reply but sorry....i can't understand what i have to do for the video works in autoplay in Crhome.

    Marco

      marco17 Try change this in file i.e./templates/uber/acm/hero/tmpl/style-4.php

      <iframe frameborder="0" width="100%" height="100%" allowfullscreen="" mozallowfullscreen="" webkitallowfullscreen="" src="<?php echo $video_src ?>"></iframe>

      to

      <iframe frameborder="0" width="100%" height="100%" allow="autoplay" allowfullscreen="" mozallowfullscreen="" webkitallowfullscreen="" src="<?php echo $video_src ?>"></iframe>

      Kindly ensure to clear your browser cache if changes dont reflect

      Hi aman204, many thanks.

      I have done the change but it is the same.

      In the smartphone with crhome it is showed the control as youtube and it works, but in the desktop with the crhome doesn't work.

      THis the code in the style-4.php actually:

      <?php
      $heroStyle = $helper->get('hero-style');
      $heroTextPos = $helper->get('hero-content-position');
      $heroTextAlign = $helper->get('hero-text-align');
      $heroHeading = $helper->get('hero-heading');
      $heroIntro = $helper->get('hero-intro');
      $heroVideo = $helper->get('hero-video');
      $heroScreen = $helper->get('hero-screen');


      $video_src = '';
      $video_link = '';
      if ($heroVideo) {
      $arr = preg_split ('/=/', $heroVideo, 2);
      if (count($arr) == 2) {

      switch (trim($arr[0])) {
      case 'vimeo':
      $video_src = '//player.vimeo.com/video/' . trim($arr[1]) . '?title=0&amp;byline=0&amp;portrait=0&amp;autoplay=1&amp;loop=1';
      $video_link = trim($arr[1]);
      break;
      case 'youtube':
      $video_src = '//www.youtube.com/embed/' . trim($arr[1]) . '?playlist=' . trim($arr[1]) . '&amp;autoplay=1&amp;loop=1&amp;html5=1';
      $video_link = trim($arr[1]);
      break;
      default:
      break;
      }
      }
      }
      ?>

      <div class="section-inner <?php echo $helper->get('block-extra-class'); ?>">
      <div class="acm-hero style-4 <?php echo ($heroStyle .' '. $heroTextPos. ' '. $heroTextAlign.' '. $heroScreen); ?> <?php if( trim($heroHeading) ) echo ' show-intro'; ?>">
      <div class="video-wrapper">
      <?php if ($heroVideo) { ?>
      <iframe frameborder="0" width="100%" height="100%" allow="autoplay" allowfullscreen="" mozallowfullscreen="" webkitallowfullscreen="" src="<?php echo $video_src ?>"></iframe>
      <?php } ?>
      <div class="container">
      <div class="hero-content">
      <?php if( trim($heroHeading)) : ?>
      <div class="hero-heading">
      <?php echo $heroHeading; ?>
      </div>
      <?php endif; ?>


            <?php if( trim($heroIntro)) : ?>
            <div class="hero-intro">
              <?php echo $heroIntro; ?>
            </div>
            <?php endif; ?>
        		
        		<?php if ($heroVideo) { ?>
            <div class="hero-btn-actions">
              <a href="http://vimeo.com/<?php echo $video_link; ?>" title="<?php if( trim($heroHeading)) : ?> <?php echo $heroHeading; ?> <?php endif; ?>" class="btn btn-border btn-border-inverse btn-rounded"><span class="sr-only">Watch the video</span><i class="fa fa-chevron-right"></i></a>
            </div>
            <?php } ?>
          </div>
      
        </div>
      </div>

      </div>
      </div>
      <script>
      (function($){

      $(document).ready(function(){
      $('.hero-btn-actions .btn-border-inverse', '.style-4').unbind('click').click(function(e) {
        $(this).parents('.style-4:first').addClass('mask-off');
        e.preventDefault();
      });
      
      $( window ).scroll(function() {
      		$('.style-4.mask-off').removeClass('mask-off');
      	});

      });

      })(jQuery);
      </script>

        marco17 I assume that Google has made some further changes in autoplay policies in furtherance to the blog article as the similar parameters isnt working now for the other site too suggested in other thread for chrome which had been working fine when I had tried adding the parameter through debugging tool

        Can you provide your admin details in edit fields in order to take closer look

        For reference, You can follow thread post (5 point) procedure.

        Sorry,

        my frien has tried and now it works fine.

        It is possible in my computer there is a Cache problem.

        Many thanks

        Write a Reply...
        You need to Login to view replies.