我无法使用HTML添加视频 [英] I am unable to add video using HTML

查看:73
本文介绍了我无法使用HTML添加视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<video width="320" height="240" controls>
 <source src="C:\chella\Chella Software with voiceover.mpg" type="video/mpg">
 <source src="C:\chella\Chella Software with voiceover.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>





但是当我运行它时视频没有播放请帮帮我



but when i run it the video is not playing please help me

推荐答案

你可以在这里阅读

http://www.w3schools.com/ tags / tag_video.asp [ ^ ]

视频标签属性src指定视频文件的URL。



C:\chella \ChellaSoftwarewithvoiceover.mpg不是URL,而是文件路径。



将您的HTML更改为:

As you can read here
http://www.w3schools.com/tags/tag_video.asp[^]
the video tag attribute "src" specifies the URL of the video file.

"C:\chella\ChellaSoftwarewithvoiceover.mpg" is not a URL, it is a file path.

Change your HTML to this:
<video width="320" height="240" controls="">
 <source src="ChellaSoftwarewithvoiceover.mpg" type="video/mpg">
 <source src="ChellaSoftwarewithvoiceover.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>



此外,您必须将视频文件复制到与HTML文件相同的文件夹中。

如果您将它们放入,例如您必须调整URL的子文件夹。


Moreover you must copy your video files to the same folder as your HTML file.
If you put them in e.g. a subfolder you must adapt the URLs.


有时带有空格的文件名会导致问题。

尝试删除文件名中的空格,即尝试重命名文件,如

Sometimes file names with white spaces causes issue.
Try removing the spaces in filename i.e, try renaming files like
ChellaSoftwarewithvoiceover.mpg
ChellaSoftwarewithvoiceover.ogg



然后相应修改来源


and then modify the source accordingly

<video width="320" height="240" controls="">
 <source src="C:\chella\ChellaSoftwarewithvoiceover.mpg" type="video/mpg">
 <source src="C:\chella\ChellaSoftwarewithvoiceover.ogg" type="video/ogg">
Your browser does not support the video tag.
</source></source></video>



希望,它有帮助:)


Hope, it helps :)


这篇关于我无法使用HTML添加视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆