动态更改WordPress上的嵌入视频URL

时间:2015-11-03 16:21:31

标签: html wordpress video youtube

我的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>

1 个答案:

答案 0 :(得分:0)

为什么不在线使用YouTube到MP4转换器下载视频,而不是将它们重定向到链接,然后将其保存在WordPress的FTP中。然后,也许你可以使用视频标签来显示MP4文件。