nsIDOMHTMLSourceElement 编辑

The nsIDOMHTMLSourceElement interface is the DOM interface to the source child of the audio and video media elements in HTML.

dom/interfaces/html/nsIDOMHTMLSourceElement.idlScriptable Please add a summary to this article.   Last changed in Gecko 1.9.1.2

Inherits from: nsIDOMHTMLElement

The source element allows authors to specify multiple media resources for media elements. It does not specify anything on its own.

Attributes

AttributeTypeDescription
srcDOMStringThe src attribute gives the address of the media resource. The value must be a valid URL. This attribute must be present. Note that dynamically manipulating this value after the page has loaded has no effect on the containing element; instead, change the src attribute of that element (audio or video) instead.
typeDOMStringThe type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it. If specified, its value must be a valid MIME type. The codecs parameter may be specified and might be necessary to specify exactly how the resource is encoded.
media UnimplementedDOMStringThe media attribute gives the intended media type of the media resource, to help the user agent determine if this media resource is useful to the user before fetching it. Its value must be a valid media query.

Example

<video controls>
  <source src="foo.webm" type="video/webm; codecs=&quot;vp9, opus&quot;">
  Your browser does not support the <code>video</code> element.
</video>

This example specifies that a video object with playback controls should be drawn, playing the file "foo.ogg". The type is specified as "video/ogg", and the source element also specifies that the video file uses the Dirac and Speex codecs.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:112 次

字数:4119

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文