How to change attribute "autoplay" in a post

Related searches

I have an issue, My WordPress blog embeds a video from Imgur. It autoplay when it is loaded. It also loops automatically. And it works perfectly with this embed HTML. However, it doesn't stop when we scroll it out of screen. How to stop it when scrolled out? thank

<center><video style="max-width: 100%; height: auto;" preload="auto" autoplay="autoplay" loop="loop" controls="controls" width="450" height="auto"><source src="https://i.imgur.com/84FAg6j.mp4" /></video></center>

I have just added id to the video tag and I have just used jQuery's play and pause options based on the scroll position. Hope this will help you.

var sec_position = $('#sec').offset().top;
var vid = document.getElementById('video');
$(window).on('scroll', function() {
  var window_position = window.pageYOffset;
  if (sec_position < window_position) {
    vid.pause();
  } else {
    vid.play();
  }
});
#sec {
  height: 500px;
  background: red;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<center><video id="video" style="max-width: 100%; height: auto;" preload="auto" autoplay="autoplay" loop="loop" controls="controls" width="450" height="auto">
    <source src="https://i.imgur.com/84FAg6j.mp4" /></video></center>
<div id="sec"></div>

In Windows, what are file attributes, and how can I change them?, On the Home tab of the Ribbon, click on the Properties button. What Attributes Can You Use? R – This command will assign the “Read-Only” attribute to your selected files or folders. H – This command will assign the “Hidden” attribute to your selected files or folders. A – This command will prepare your selected files or folders for “Archiving.”. S – This

You can use jQuery:

HTML

adding an ID your element:

<video id="myvideo" style="max-width: 100%; height: auto;" preload="auto" 
autoplay="autoplay" loop="loop" controls="controls" width="450" height="auto">

JS

calling pause on scroll

$('#myvideo').bind("ended", function(){ 
   $('html, body').animate({
    scrollTop: $(".big-div").offset().top
}, 2000);
});


function isInView(el) {
  var rect = el.getBoundingClientRect();          
  return !(rect.top > $(window).height() || rect.bottom < 0);   // visible?
 }

 $(document).on("scroll", function() {
  $( "#myvideo" ).each(function() {
    if (isInView($(this)[0])) {                    // visible?
      if ($(this)[0].paused) $(this)[0].play();    // play if not playing
    }
    else {
      if (!$(this)[0].paused) $(this)[0].pause();  // pause if not paused
    }
  });  
});

CSS

.big-div{
  height:1000px;
  background:orange;
 }

Don't forget to include jQuery before initializing the function (in the header)

 <script 
 src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"> 
 </script>

check out my example: https://plnkr.co/edit/REanzIzi7Pb33UPHLJo9?p=preview

Scroll down and up again after some time to see the video was paused.

How to Change File Attributes with Attrib from the Windows , To view or change the attributes of a file, right-click the file, and then click Properties. In the "Attributes:" section, enabled attributes have checks� In Recovery Console, +c and -c switches apply to attrib. They set and clear the compressed file attribute, respectively. Outside of this diagnostic area in Windows XP, use the compact command to handle file compression from the command line.

You can use isInViewport jQuery plugin as below:

$('video').each(function(){
    if ($(this).is(":in-viewport")) {
        $(this)[0].play();
    } else {
        $(this)[0].pause();
    }
})

Attribute Changer: Home, S – This command will change your selected files or folders by assigning the “ System” attribute. “Attrib” Syntax. You will need to know the proper� We can use two approaches to modify an attribute of an HTML element using JavaScript. Approach 1: We can use the inbuilt setAttribute() function of JavaScript. Syntax: var elementVar = document.getElementById("element_id"); elementVar.setAttribute("attribute", "value");

Change File and Folder Attributes With Attribute Changer, Attribute Changer 9. Change file and folder properties with ease. Version 9.50a� Simple file attributes like hidden, read-only, archive … etc can be changed easily by file properties in windows. in case you want to change advanced attributes, you can pick one of the following tools. Using attrib command in CMD The attrib command is a CMD command used to display, sets, or removes attributes assigned to files or directories.

Do all that and more with this useful file management tool for Windows. Attribute Changer lets you change and modify files and folders on your� To change the read-only attribute, follow these steps: Right-click the file or folder icon. Remove the check mark by the Read Only item in the file’s Properties dialog box. The attributes are found at the bottom of the General tab.

In order to reset/respec your skills or attributes in the Elder Scrolls Online you need to visit a Rededication Shrine. See the maps below for their exact location. You will notice three shrines. You can ignore the Shrine of Mara, it has nothing to do with resetting your skills or attributes.

Comments
  • It have run code snipptet and it work as my expectation. However, I am not familiar with wordpress. Can you help me how to apply it. Thank you
  • Thank you... video tag code paste to your like a page then js code paste to footer.
  • It is that what I want :)