我的wordpress主页上有一个来自youtube的嵌入视频,我想动态更改此嵌入视频,而无需编辑我的wordpress设置。
我试图创建一个重定向到我的视频的自定义网页,因此我只需要运行一个脚本来更改该页面的URL,但它不起作用,关于如何修复它的任何线索?
我曾经按照以下代码进行重定向:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=http://https://www.youtube.com/watch?v=Eho8HDtkCiU">
<script type="text/javascript">
window.location.href = "http://https://www.youtube.com/watch?v=Eho8HDtkCiU"
</script>
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the <a href='http://https://www.youtube.com/watch?v=Eho8HDtkCiU'>link to example</a>
</body>
</html>
最佳答案
与其将他们重定向到链接,不如不使用YouTube在线将视频下载到MP4转换器,然后将其保存在WordPress的FTP中。然后,也许您可以使用视频标签显示MP4文件。
关于html - 在WordPress上动态更改嵌入视频URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33504090/