简体   繁体   English

WordPress无法呈现HTML5视频

[英]WordPress Not Rendering HTML5 Video

I am trying to create a splash page in WordPress (which I have done), but the video I would like to play isn't being located by the browser. 我正在尝试在WordPress中创建启动页面(已完成),但是浏览器未找到我想播放的视频。

This works when not in WordPress. 不在WordPress中时可以使用。 But once inside WordPress, it's not. 但是一旦进入WordPress,就不是。 Here's my code: 这是我的代码:

<?php
/*
Template Name: Splash
*/
?>

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Iron Triangle Films Splash Page</title>
   <link rel="stylesheet" href="css/styles.">
    <style>
   .mainContent{
       width: 50%;
       margin-left: 250px;
   }
   </style>
  </head>
<body>
 <div class="mainContent">
 <video id="my_video" height="500" width="700" autoplay>
 <source src="<?php echo get_bloginfo('template_directory');?> itf.mp4"   type="video/mp4">
  <source src="<?php echo get_bloginfo('template_directory');?> itf.ogv" type="video/ogg">
   <p>Your browser does not support HTML5 video.</p>
 </video>

 <p style="text-align: center;">This site is currently under development and will be back online shortly.</p>
  </div><!--End Main Content div-->
 </body>
</html>

The following line of code in the video source: 视频源中的以下代码行:

            <?php echo get_bloginfo('template_directory');?>

Was suggested by someone, but this did not work. 由某人建议,但这没有用。

The site is www.irontrianglefilms.com 该网站是www.irontrianglefilms.com

I'd appreciate your assistance this is day#2 trying to tackle this issue. 非常感谢您在尝试解决此问题的第二天。 Chris Mazzochi 克里斯·马佐基

Try with this one, remember to add the "/" after calling the functions to get a directory. 尝试使用此命令,记住在调用函数以获取目录后添加“ /”。

   <?php
/*
Template Name: Splash
*/
?>

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Iron Triangle Films Splash Page</title>
   <link rel="stylesheet" href="css/styles.">
    <style>
   .mainContent{
       width: 50%;
       margin-left: 250px;
   }
   </style>
  </head>
<body>
 <div class="mainContent">
 <video id="my_video" height="500" width="700" autoplay>
 <source src="<?php echo get_bloginfo('template_directory');?>/itf.mp4"   type="video/mp4">
  <source src="<?php echo get_bloginfo('template_directory');?>/itf.ogv" type="video/ogg">
   <p>Your browser does not support HTML5 video.</p>
 </video>

 <p style="text-align: center;">This site is currently under development and will be back online shortly.</p>
  </div><!--End Main Content div-->
 </body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM