我有一个通过 CMS 创建的页面,目前看起来像这样:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p><iframe src="//www.youtube.com/embed/id?start=1" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen" allow="autoplay"></iframe></p>
</body>
</html>
我已经看到了与我需要的类似的东西,但是有没有特别的方法可以使用 JS 块,这样每当我有一个带有 youtube url 的 iframe 时,我都可以将“&autoplay=1&mute=1”添加到源 URL 到得到:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p><iframe src="//www.youtube.com/embed/id?start=1&autoplay=1&mute=1" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen" allow="autoplay"></iframe></p>
</body>
</html>