How to disable autoplay of the movie in XHTML transitional

让人想犯罪 __ 提交于 2019-12-11 18:28:50

问题


Here's my code

<object type="application/x-shockwave-flash" style="width:425px; height:349px;" data="multimedia/1.mp4">
<param name="movie" value="multimedia/1.mp4" />
<param name="autoplay" value="false" />
<param name="allowFullScreen" value="true" />
</object>

When i open my website, the movies are automatically playing.

What is the solution so i can disable the autoplay of my movies in my website that use XHTML transitional?


回答1:


I'd remove the autoplay attribute, since if the browser finds the autoplay string, it autoplays!

The autoplay is not a boolean type.

Also, the type goes inside the source, like this:

<video width="640" height="480" controls preload="none">
   <source src="http://example.com/mytestfile.mp4" type="video/mp4">
   Your browser does not support the video tag.
</video>

or

Try adding autostart="false" to your source tag.

<video width="640" height="480" controls="controls" type="video/mp4" preload="none">
<source src="http://example.com/mytestfile.mp4" autostart="false">
Your browser does not support the video tag.
</video>

JSFiddle example



来源:https://stackoverflow.com/questions/55999442/how-to-disable-autoplay-of-the-movie-in-xhtml-transitional

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!