当前位置: 首页 > 网络学院 > 网页制作基础教程 > Internet > 在网络中播放视频
Videos can be played "inline" or by a "helper", depending on the HTML element you use.
视频可以通过“线内播放”,也可以通过播放器播放,这主要取决于所使用的HTML元素。
When a video is included in a web page it is called inline video.
网页中嵌套的视频叫线内视频。
Inline video can be added to a web page by using the <img> element.
线内视频可以使用<img>元素添加到网页中。
If you plan to use inline videos in your web applications, be aware that many people find inline videos annoying. Also note that some users might have turned off the inline video option in their browser.
如果你计划在网络应用程序中使用线内视频,那么要注意一点,就是很多人都很反感线内视频;你还要注意这些要素,一些用户可能会在他们的浏览器中关闭这些在线视频。
Our best advice is to include inline videos only in web pages where the user expects to see a video. An example of this is a page which opens after the user has clicked on a link to see the video.
我们为您提供的最好的建议就是:只在用户希望看到视频的页面中使用视频。如:用户点击了“希望链接到视频页面” 的链接之后显示视频。
A helper application is a program that can be launched by the browser to "help" playing a video. Helper applications are also called Plug-Ins.
视频播放助手程序可以通过浏览器激发来帮助放映一段视频。视频播放助手程序也通常称为内置插件。
Helper applications can be launched using the <embed> element, the <applet> element, or the <object> element.
视频播放助手程序可以使用<embed>元素、<applet>元素或者<object>元素激发。
One great advantage of using a helper application is that you can let some (or all) of the player settings be controlled by the user.
使用视频播放助手程序的其中一个最大的好处就是:可以让用户来控制播放器的一部分设置。
Most helper applications allow manual (or programmed) control over the volume settings and play functions like rewind, pause, stop and play.
大多数视频播放助手程序允许手动(或程序)来控制音量设置,并且控制如:环绕、暂停、停止和播放这样的函数。
Internet Explorer supports the dynsrc attribute in the <img> element.
IE支持<img>元素中的dynsrc属性。
The purpose of this element is to embed multimedia elements in web page:
这个元素的目的就是在网页中嵌套多媒体元素:
<img dynsrc="video.avi" /> |
The code fraction above displays an AVI file embedded in a web page.
上述的代码片断显示了一段在网页中嵌套的AVI文件:
Note: The dynsrc attribute is not a standard HTML or XHTML attribute. It is supported by Internet Explorer only.
注意:dynsrc属性并不是标准的HTML或XHTML属性。现在仅有IE支持它。
Internet Explorer and Netscape both support an element called <embed>.
IE和网景浏览器都支持<embed>元素。
The purpose of this element is to embed multimedia elements in web page:
使用该元素的目的就是在网页中嵌套多媒体元素:
<embed src="video.avi" /> |
The code fraction above displays an AVI file embedded in a web page.
上述的代码片断显示了一段在网页中嵌套的AVI文件:
A list of attributes for the <embed> element can be found in a later chapter of this tutorial.
关于<embed>元素的属性列表可以在该教程的后面章节中找到。
Note: The <embed> element is supported by both Internet Explorer and Netscape, but it is not a standard HTML or XHTML element. The World Wide Web Consortium (W3C) recommend using the <object> element instead.
注意:<embed>元素同时被IE和网景浏览器支持,但是,它不是标准的HTML或XHTML元素。国际万维网组织(W3C)推荐使用<object>元素来代替。
Internet Explorer and Netscape both support an HTML element called <object>.
IE和网景同时支持<object>这个HTML元素。
The purpose of this element is to embed multimedia elements in web page:
使用该元素的目的就是在网页中嵌套多媒体元素:
<object data="video.avi" type="video/avi" /> |
The code fraction above displays an AVI file embedded in a web page.
上述的代码片断显示了一段在网页中嵌套的AVI文件:
A list of attributes for the <object> element can be found in a later chapter of this tutorial.
关于<object>元素的属性列表可以在该教程的后面章节中找到。
If a web page includes a hyperlink to a media file, most browsers will use a "helper application" to play the file:
如果网页中包含了一个链接到多媒体文件的超链接,那么大多数浏览器将使用一个“视频播放助手程序”来播放该文件:
<a href="video.avi"> |
The code fraction above displays a link to an AVI file. If the user clicks on the link, the browser will launch a helper application like Windows Media Player to play the AVI file.
上述的代码片断显示了一段在网页中嵌套的AVI文件。如果用户点击了链接,那么浏览器就会打开诸如像Windows Media Player这样的播放工具来播放AVI文件。