HTML5 Video Autoplay not working correctly

后端 未结 7 1151
鱼传尺愫
鱼传尺愫 2020-12-09 08:19

Im using this code:

相关标签:
7条回答
  • 2020-12-09 09:26

    html {
      padding: 20px 0;
      background-color: #efefef;
    }
    
    body {
      width: 400px;
      padding: 40px;
      margin: 0 auto;
      background: #fff;
      box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
    }
    
    video {
      width: 400px;
      display: block;
    }
    <video onloadeddata="this.play();this.muted=false;" poster="https://durian.blender.org/wp-content/themes/durian/images/void.png" playsinline loop muted controls>
        <source src="http://grochtdreis.de/fuer-jsfiddle/video/sintel_trailer-480.mp4" type="video/mp4" />
        Your browser does not support the video tag or the file format of this video.
    </video>

    0 讨论(0)
提交回复
热议问题