H5 short video autoplay can not be turned off? Why does autoplay="false" not work? Can it be realized by adding JavaScript control code?

H5 short video autoplay can not be turned off? Why doesn't autoplay="false" work?

I have been troubled by this problem for a while. I wonder if there are any friends who have searched for a long time like me but have not found a solution. Even adding the JS code, it didn't work out.

But today I had a sudden inspiration, and I solved it. Share it here:

Adding embed codes in H5, usually we can think of adding autoplay="false"

There's nothing wrong with that, but why is the video still autoplaying? In fact, it is wrong to add for our position.

For example, we need to add such a video: 

<iframe src="//player.bilibili.com/player.html?bvid=BV1hM4y1h7BX&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

If you want to turn off the autoplay of the embed code, just add a parameter to srcthe attributeautoplay=false . For example:

<iframe src="//player.bilibili.com/player.html?bvid=BV1hM4y1h7BX&page=1&autoplay=false" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

Guess you like

Origin blog.csdn.net/Smile1552911411/article/details/130249040