Solution: Add the "autoplay" attribute to the video tag video. The autoplay attribute specifies that the video will start playing as soon as it is ready. If this attribute is set, the video will automatically play. The syntax is "
The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.
What to do if the html5 video does not play automatically
If you want to solve the problem that the video does not play automatically in html5, you need to use the autoplay attribute.
The autoplay attribute is a boolean (Boolean) attribute.
The autoplay attribute specifies that playback begins as soon as the video is ready. If this property is set, the video will play automatically.
The example is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <video src="/i/movie.ogg" controls="controls" autoplay> 暂时没法播放 </video> </body> </html>
Output result:
##Recommended tutorial: "html video tutorial 》
The above is the detailed content of What to do if html5 video does not play automatically. For more information, please follow other related articles on the PHP Chinese website!