ÍøÂçѧԺ

w3pop.com :: ÍøÂçѧԺ :: Internet :: ÔÚÍøÂçÖв¥·ÅÊÓÆµ

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

Internet
TCP/IP ½éÉÜ
TCP/IP µØÖ·
TCP/IP ЭÒé
TCP/IP µç×ÓÓʼþ
ÍøÕ¾½¨Éè
ÍøÂçÉè¼Æ
ÍøÂçÓû§
ÍøÂç±ê×¼
ÍøÒ³ÈÏÖ¤
ÍòÎ¬ÍøÁªÃË
ÍøÂ簲ȫ
ÍøÂçÊõÓï±í
ÍøÂçËÑË÷ÒýÇæ
ÍøÂç¶àýÌå¼ò½é
¶àýÌåÒôƵ¸ñʽ
¶àýÌåÊÓÆµ¸ñʽ
ÔÚÍøÂçÖв¥·ÅÒôƵ
ÔÚÍøÂçÖв¥·ÅÊÓÆµ
Windows¶àýÌå¸ñÊ..
¶ÔÏóÔªËØ

ÔÚÍøÂçÖв¥·ÅÊÓÆµ


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-29 ä¯ÀÀ:8740 :: ::

Videos can be played "inline" or by a "helper", depending on the HTML element you use.
ÊÓÆµ¿ÉÒÔͨ¹ý“ÏßÄÚ²¥·Å”£¬Ò²¿ÉÒÔͨ¹ý²¥·ÅÆ÷²¥·Å£¬ÕâÖ÷Ҫȡ¾öÓÚËùʹÓõÄHTMLÔªËØ¡£


Inline Videos
ÏßÄÚÊÓÆµ

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.
ÎÒÃÇΪÄúÌṩµÄ×îºÃµÄ½¨Òé¾ÍÊÇ£ºÖ»ÔÚÓû§Ï£Íû¿´µ½ÊÓÆµµÄÒ³ÃæÖÐʹÓÃÊÓÆµ¡£È磺Óû§µã»÷Á˓ϣÍûÁ´½Óµ½ÊÓÆµÒ³Ãæ” µÄÁ´½ÓÖ®ºóÏÔʾÊÓÆµ¡£


Using A Helper (Plug-In)
ʹÓÃÊÓÆµ²¥·ÅÖúÊÖ£¨ÄÚÖòå¼þ£©

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.
´ó¶àÊýÊÓÆµ²¥·ÅÖúÊÖ³ÌÐòÔÊÐíÊÖ¶¯£¨»ò³ÌÐò£©À´¿ØÖÆÒôÁ¿ÉèÖ㬲¢ÇÒ¿ØÖÆÈ磺»·ÈÆ¡¢ÔÝÍ£¡¢Í£Ö¹ºÍ²¥·ÅÕâÑùµÄº¯Êý¡£


Using The <img> Element
ʹÓÃ<img>ÔªËØ

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ÊôÐÔ²¢²»ÊDZê×¼µÄHTML»òXHTMLÊôÐÔ¡£ÏÖÔÚ½öÓÐIEÖ§³ÖËü¡£


Using The <embed> Element
ʹÓÃ<embed>ÔªËØ

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ºÍÍø¾°ä¯ÀÀÆ÷Ö§³Ö£¬µ«ÊÇ£¬Ëü²»ÊDZê×¼µÄHTML»òXHTMLÔªËØ¡£¹ú¼ÊÍòÎ¬Íø×éÖ¯£¨W3C£©ÍƼöʹÓÃ<object>ÔªËØÀ´´úÌæ¡£


Using The <object> Element
ʹÓÃ<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>ÔªËØµÄÊôÐÔÁбí¿ÉÒÔÔڸý̵̳ĺóÃæÕ½ÚÖÐÕÒµ½¡£


Using A Hyperlink
ʹÓÃÒ»¸ö³¬Á´½Ó

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">
Click here to play a video file
</a>

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Îļþ¡£

ÆÀÂÛ (0) All