📄 media_browservideos.asp
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Playing Videos In The Browser</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />
<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<link rel="stylesheet" type="text/css" href="../stdtheme.css" />
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</head>
<body>
<a name="top"></a>
<table cellpadding="0" cellspacing="0" width="100%" bgcolor="#808080">
<tr>
<td width="234" valign="top">
<a href="../default.htm"><img src="../images/w3default80.jpg" border="0" alt="W3Schools" /></a>
</td>
<th valign="middle" align="left" class="right">
<iframe style="background-color:#808080" src="../banners/bannerframe.asp@adpartner=w3markup" height="90" width="728"
marginwidth="0" marginheight="0" frameborder="0" scrolling="no">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>
<br /></th>
</tr>
</table>
<table style="margin-left:1px" width="800px" border="0" cellpadding="0" cellspacing="2">
<tr>
<td width="137" class="content" valign="top"><br />
<a class="left" href="../default.asp" target="_top">
<img src="../images/homeicon.gif" border="0" alt="home" /></a>
<a class="left" href="../default.asp" target="_top">
<b>HOME</b></a>
<br /><br />
<b>Media Basic</b><br />
<a class="left" target="_top" href="default.asp" >Media HOME</a><br />
<a class="left" target="_top" href="media_intro.asp" >Media Intro</a><br />
<a class="left" target="_top" href="media_soundformats.asp" >Sound Formats</a><br />
<a class="left" target="_top" href="media_videoformats.asp" >Video Formats</a><br />
<a class="left" target="_top" href="media_browsersounds.asp" >Playing Sounds</a><br />
<a class="left" target="_top" href="media_browservideos.asp" style='font-weight:bold;'>Playing Videos</a><br />
<a class="left" target="_top" href="media_windowsformats.asp" >Windows Formats</a><br />
<br />
<b>Object Element</b><br />
<a class="left" target="_top" href="media_object.asp" >Object Intro</a><br />
<a class="left" target="_top" href="media_quicktime.asp" >Object QuickTime</a><br />
<a class="left" target="_top" href="media_realvideo.asp" >Object RealVideo</a><br />
<br />
<b>References</b><br />
<a class="left" target="_top" href="media_tagref.asp" >Tag Reference</a><br />
<a class="left" target="_top" href="media_playerref.asp" >Media Player Ref</a><br />
<a class="left" target="_top" href="media_mimeref.asp" >MIME Reference</a><br /><br />
<b>Selected Reading</b><br />
<a class="left" target="_top" href="../browsers/browsers_stats.asp">Web Statistics</a><br />
<a class="left" target="_top" href="../site/site_glossary.asp">Web Glossary</a><br />
<a class="left" target="_top" href="../hosting/default.asp">Web Hosting</a><br />
<a class="left" target="_top" href="../quality/default.asp">Web Quality</a><br /><br />
<a class="left" target="_top" href="../forum/default.asp">W3Schools Forum</a><br /><br />
<a class="left" target="_top" href="../about/about_helping.asp">Helping W3Schools</a><br /><br />
<script type="text/javascript"><!--
google_ad_client = "pub-3440800076797949";
/*LeftLinkUnit*/
google_ad_slot = "4854527104";
google_ad_width = 120;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="../../pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
<td valign="top">
<table style="border: 1px solid gray" width="100%" bgcolor="#FFFFFF" border="0" cellpadding="5" cellspacing="0">
<tr>
<td>
<h1>Playing Videos On The Web</h1>
<a href="media_browsersounds.asp"><img border="0" src="../images/btn_previous.gif" width="100" height="20" alt="Previous" /></a>
<a href="media_windowsformats.asp"><img border="0" src="../images/btn_next.gif" width="100" height="20" alt="Next" /></a>
<hr />
<p><b>Videos can be played "inline" or by a "helper",
depending on the HTML element you use.</b></p>
<hr />
<h2>Inline Videos</h2>
<p>When a video is included in a web page it is called
inline video.</p>
<p>Inline video can be added to a web page by using the
<img> element.</p>
<p>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.</p>
<p>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.</p>
<hr />
<h2>Using A Helper (Plug-In)</h2>
<p>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.</p>
<p>Helper applications can be launched using the <embed> element, the <applet>
element, or the <object> element.</p>
<p>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.</p>
<p>Most helper applications allow manual (or programmed) control over the volume
settings and play functions like rewind, pause, stop and play.</p>
<hr />
<h2>Using The <img> Element</h2>
<p>Internet Explorer supports the dynsrc attribute in the <img> element.</p>
<p>The purpose of this element is to embed multimedia elements in web page:</p>
<table width="100%" border="1" class="ex" cellspacing="0">
<tr>
<td>
<pre><img dynsrc="video.avi" /></pre>
</td>
</tr>
</table>
<p>The code fraction above displays an AVI file embedded in a web
page.</p>
<p><b>Note:</b> The dynsrc attribute is not a standard HTML or XHTML attribute.
It is supported by Internet Explorer only.</p>
<hr />
<h2>Using The <embed> Element</h2>
<p>Internet Explorer and Netscape both support an element called <embed>.</p>
<p>The purpose of this element is to embed multimedia elements in web page:</p>
<table width="100%" border="1" class="ex" cellspacing="0">
<tr>
<td>
<pre><embed src="video.avi" /></pre>
</td>
</tr>
</table>
<p>The code fraction above displays an AVI file embedded in a web
page.</p>
<p>A list of attributes for the <embed> element can be found in a later chapter
of this tutorial.</p>
<p><b>Note:</b> 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.</p>
<hr />
<h2>Using The <object> Element</h2>
<p>Internet Explorer and Netscape both support an HTML element called <object>.</p>
<p>The purpose of this element is to embed multimedia elements in web page:</p>
<table width="100%" border="1" class="ex" cellspacing="0">
<tr>
<td>
<pre><object data="video.avi" type="video/avi" /></pre>
</td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -