您好,今天是: ·加入收藏·设为首页·联系站长
洛歌教程网--本站提供(PS教程)
站内搜索:
当前位置:洛歌教程网 >> 网站建设 >> HTML基础知识 >> 浏览文章  
HTML5的结构和语义(5):内嵌媒体
作者:admin 来源:网络 文章点击数:

  视频已经在 Web 上广泛流行了,但是其格式几乎都是专有的。YouTube 使用 Flash,Microsoft 使用 Windows Media®,Apple 使用 QuickTime。在一种浏览器中用来嵌入这些内容的标记在另一种浏览器中是无效的。因此,WhatWG 提议引入一个新的 video 元素,用来嵌入任意视频格式。例如,可以用以下代码嵌入我的 QuickTime 电影 “a Sora in Prospect Park”:

<video src="http://www.cafeaulait.org/birds/sora.mov" />

  对于以哪种格式和解码器作为首选,仍然有争议。可能会强力推荐或要求使用 Ogg Theora。还可以可选地支持 QuickTime 等专有格式和 MPEG-4 等受专利限制的格式。实际使用的格式很可能由市场决定,就像是 GIF、JPEG 和 PNG 格式那样(这些格式通过市场竞争压倒了 BMP、X-Bitmap 和 JPEG 2000 等竞争者,成为 img 元素的首选格式)。

  还提议引入 audio 元素。例如,可以使用以下代码给 Web 页面加上背景音乐:

<audio src="spacemusic.mp3"   autoplay="autoplay" loop="20000" />

  autoplay 属性指示浏览器在装载页面后立即开始播放,而不等待明确的用户请求。音频循环播放 20,000 次,然后停止(或者在用户关闭窗口或转到另一个页面时停止)。当然,浏览器可以(而且应该)允许用户关闭内嵌的媒体,不应该只按页面作者的要求去做。

  浏览器必须支持 WAV 格式,还可以支持 MP3 等其他格式。

  因为老式浏览器不支持这些元素,而且它们对于盲人和聋人用户来说没有意义,所以 audio 和 video 元素可以包含额外的标记,用来描述音频和视频的内容。这对搜索引擎也有帮助。在理想情况下,这些标记是音频和视频内容的完整文字版本。例如,代码8 显示 用 HTML 5 编写的 John F. Kennedy 的就职演说。

<audio src="kennedyinauguraladdrees.mp3">

    <p>

    Vice President Johnson, Mr. Speaker, Mr. Chief Justice,

    President Eisenhower, Vice President Nixon, President Truman,

    Reverend Clergy, fellow citizens:

    </p>   

    <p>

    We observe today not a victory of party, but a celebration of

    freedom -- symbolizing an end, as well as a beginning --

   signifying renewal, as well as change. For I have sworn before

    you and Almighty God the same solemn oath our forebears

    prescribed nearly a century and three-quarters ago.

    </p>   

    <p>

    The world is very different now. For man holds in his mortal

    hands the power to abolish all forms of human poverty and all

forms of human life. And yet the same revolutionary beliefs for

    which our forebears fought are still at issue around the globe --

    the belief that the rights of man come not from the

    generosity of the state, but from the hand of God.

    </p>   

    <p>

    ...

    </p>   

    </audio>

  (待续)

讨论:http://www.missyuan.com/viewthread.php?tid=266299




人支持

发表评论】【告诉好友】【打印此文】【收藏此文】【关闭窗口
下一篇:没有了
  最新文章
  热门文章
  推荐文章

| 设为首页 | 加入收藏 | 关于本站 | 联系站长 | 友情链接 | 版权申明 | 雁过留声 |

Copyright◎ 2003-2007 www.logooe.com All Rights Reserved Contact us

Email:liyushuai755#163.com QQ:65557616

版权归作者所有,如果无意中侵犯了您的版权,请来信告知,本站将再3个工作日内删除。

备案序号:琼ICP备06003564号

 


Free

本站(洛歌教程网)提供如下信息:PS教程,PhotoShop教程,SoftImage 3D教程,AutoCAD教程,maya教程,3ds max教程,平面设计欣赏,ImageReady教程,Illustrator教程,Coreldraw教程,Flash教程,freehand教程,fireworks教程,图像辅助