2016-08-28 58 views
0
<?php 

/* Template Name: testvideo */ 
?> 
<video width="320" height="240" controls> 

<source src=:"videos/VfE_html5.mp4" type="video/mp4"> 

</video> 

此代码工作正常,当它播放独立的html文件,但是当我使用这个作为wordpress自定义页面自我托管的视频不播放,但如果我使用外部url视频工作正常,我不知道什么是错的?无法在自定义WordPress页面上播放视频?

+0

读取[此](https://codex.wordpress.org/Inserting_Media_into_Posts_and_Pages) –

回答

2

你必须为源标签提供有效的视频网址。请尝试下面的代码。

<?php 
/* Template Name: testvideo */ 
?> 
<video width="320" height="240" controls> 
    <source src="<?php echo get_template_directory_uri(); ?>/videos/VfE_html5.mp4" type="video/mp4"> 
</video> 
+0

仍然不work.invalid源 –

1
<?php 

/* Template Name: testvideo */ 
?> 
<video width="320" height="240" controls> 

<source src=<?php echo get_template_directory_uri(); ?>"/videos/VfE_html5.mp4" type="video/mp4"> 

</video> 
+0

仍然不work.invalid源 –