HTML5 video tag autoplay processing method

There are many solutions on the Internet, but none of them can really solve the problem, so I tried it myself.

video tag attribute

  • src: set display video path
  • controls: display the control bar
  • loop: control video loop playback
  • autoplay: autoplay
  • muted: set mute playback

video属性:muted autoplay loop

Platform/Browser comes with safari uc WeChat QQ firefox chrome Baidu 360 IE Edge
ios ✔ ✔ ✘ ✘ ✘ ✔ ✔ ✔ ✔ ∅ ∅
pc ∅ ✔ ∅ ✔ ✔ ✔ ✔ ✔ ✔ ✔
android ∅ ✔ ✘ ✔ ✘ ✔ ✔ ∅ ∅
Huawei ✔ ∅ ✔ ✘ ✔ ✘ ✔ ✔ ∅ ∅
Xiaomi ✔ ∅ ✘ ✘ ∅ ∅
vivo/oppo ∅ ✘ ∅ ∅
 

<div id="player"></div>
<script src="//player.polyv.net/script/player.js"></script>
<script>
var player = polyvPlayer({
wrap: '#player',
autoplay:'true',
loop:'true',
width: '600',
height: 0,
vid: '88083abbf5f16507525894e5a997aeb2_8',
});
</script>

Guess you like

Origin blog.csdn.net/suny2020/article/details/127575461