Video and audio players - Plugins 编辑

There are a number of ways to play back web media depending on the scale of your needs and whether you need ad integration and digital rights management.

For media playback on the web, a spectrum of options is available including:

  • An embedded media element with default or custom user agent controls.
  • Digital rights management using Encrypted Media Extensions.
  • Open source or commercial players which provide ready made solutions for needs such as ads integration, and adaptive bitrate streaming.

This page defines and discusses these options, all of which must be considered when deciding how to play back media on your web page.

Considerations

Media Elements

The most straightforward way to play back a media file is with the <video> element or the <audio> element. This is suitable for basic playback, which generally means:

  • A single or small number of WebM or MP4 files.
  • No advertising.
  • You don't need adaptive bitrate (ABR) streaming or digital rights management (DRM).

User Interface Controls

For user interface controls, you actually have a choice between custom player controls and native controls. Custom controls require more elements and custom scripts. Adding native controls is as simple as adding the controls attribute to your <audio> or <video> element. For example:

<video src="videofile.webm" controls></video>

There are several things to consider when choosing. Native controls are optimized for the browser but are inconsistent between browsers. Custom controls allow you to build for accessibility, add your own branding, and keep the look and feel consistent between browsers.

See Mobile Web Video Playback and Audio and video delivery for more information on custom controls.

    Adaptive Bitrate Streaming

    Adaptive Streaming offers multiple resolutions and bitrates to the user by having the player choose which quality level and bitrate to play based upon the user's bandwidth and other factors. This generally results in a significantly better user experience with less buffering and smoother playback leading to longer watch times. This is accomplished by using the Media Source Extensions API to build to one of the adaptive bitrate standards, in other words, DASH or HLS. Although it's possible to build your own player using these technologies, it is not recommended.

    Digital Rights Management

    You may be happy sharing your content with anyone who wants it. Or maybe your content is also your livelihood, in which case you'll need Encrypted Media Extensions (EME) or a player that supports digital rights management (DRM). See DRM and authentication for more details.

    Ads Integration

    Your player will need to integrate with ad SDKs such as, for example, IMA SDK or Freewheel. Either work with your ad partners directly or partner with a player company or an online video provider who has already done these integrations.

    Media Players

    There are both open source and commercial options. While open source solutions will allow you to implement media playback without a licensing fee, commercial vendors can help you with ads integration and DRM.

    Open Source Players:

    Commercial Players

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

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

    发布评论

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

    词条统计

    浏览:60 次

    字数:6042

    最后编辑:7 年前

    编辑次数:0 次

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