开发视频播放器应用程序Develop video player applications

概述Overview

Azure 媒体服务提供所需的工具,以便创建适用于大多数平台的丰富、动态的客户端播放器应用程序,这些平台包括:iOS 设备、Android 设备、Windows、Windows Phone、Xbox 和机顶盒。Azure Media Services provides the tools you need to create rich, dynamic client player applications for most platforms including: iOS Devices, Android Devices, Windows, Windows Phone, Xbox, and Set-top boxes. 本主题还提供可用于开发自己的客户端应用程序(这些应用程序使用 Azure 媒体服务中的流媒体)的 SDK 和播放器框架的链接。This topic also provides links to SDKs and Player Frameworks that you can use to develop your own client applications that can consume streaming media from Azure Media Services.

备注

创建 AMS 帐户后,会将一个处于“已停止”状态的默认流式处理终结点添加到帐户。 When your AMS account is created a default streaming endpoint is added to your account in the Stopped state. 若要开始对内容进行流式处理并利用动态打包和动态加密功能,必须确保要从其流式获取内容的流式处理终结点处于“正在运行”状态。To start streaming your content and take advantage of dynamic packaging and dynamic encryption, the streaming endpoint from which you want to stream content has to be in the Running state.

Azure Media PlayerAzure Media Player

Azure Media Player 是 Web 视频播放器,用于在各种浏览器和设备中播放 Azure 媒体服务中的媒体内容。Azure Media Player is a web video player built to play back media content from Azure Media Services on a wide variety of browsers and devices. Azure Media Player 采用行业标准(如 HTML5、媒体源扩展 (MSE) 和加密媒体扩展插件 (EME))来提供更丰富的自适应流式处理体验。Azure Media Player utilizes industry standards, such as HTML5, Media Source Extensions (MSE), and Encrypted Media Extensions (EME) to provide an enriched adaptive streaming experience. 如果无法在设备或浏览器中提供这些标准,Azure 媒体播放器会采用 Flash 和 Silverlight 作为回退技术。When these standards are not available on a device or in a browser, Azure Media Player uses Flash and Silverlight as fallback technology. 如果不考虑所使用的播放技术,开发人员将有一个统一的 JavaScript 接口来访问 API。Regardless of the playback technology used, developers will have a unified JavaScript interface to access APIs. 这使 Azure 媒体服务提供的内容无需其他措施便可在各种设备和浏览中轻松播放。This allows for content served by Azure Media Services to be played across a wide-range of devices and browsers without any extra effort.

Azure 媒体服务允许播放使用 DASH、平滑流式处理和 HLS 流式处理格式提供的内容。Azure Media Services allows for content to be served up with DASH, Smooth Streaming, and HLS streaming formats to play back content. Azure 媒体播放器会考虑这些不同的格式并基于平台/浏览器功能自动播放最佳链接。Azure Media Player takes into account these various formats and automatically plays the best link based on the platform/browser capabilities. Azure 媒体服务还允许使用 PlayReady 加密或 AES 128 位信封加密对资产进行动态加密。Azure Media Services also allows for dynamic encryption of assets with PlayReady encryption or AES-128 bit envelope encryption. Azure 媒体播放器在合理配置时允许对 PlayReady 和 AES-128 位加密的内容进行解密。Azure Media Player allows for decryption of PlayReady and AES-128 bit encrypted content when appropriately configured.

更多相关信息:For more information:

用于创建播放器应用程序的其他工具Other Tools for Creating Player Applications

也可以使用以下任意 SDK:You can also use any of the following SDKs:

广告Advertising

Azure 媒体服务通过“Windows 媒体平台:播放器框架”提供广告插入支持。Azure Media Services provides support for ad insertion through the Windows Media Platform: Player Frameworks. 附带广告支持的播放器框架在 Windows 8、Silverlight、Windows Phone 8 和 iOS 设备上均可用。Player frameworks with ad support are available for Windows 8, Silverlight, Windows Phone 8, and iOS devices. 每个播放器框架包含演示如何实现播放器应用程序的示例代码。Each player framework contains sample code that shows you how to implement a player application. 可以插入媒体中的广告有三种不同类型:There are three different kinds of ads you can insert into your media:

线性 - 暂停主视频的全帧广告Linear – full frame ads that pause the main video

非线性 - 播放主视频时显示的覆盖式广告,通常为放置在播放器内的一个徽标或其他静态图像Nonlinear – overlay ads that are displayed as the main video is playing, usually a logo or other static image placed within the player

随播 - 在播放器之外显示的广告Companion – ads that are displayed outside of the player

广告可置于主视频时间线中的任何一个时间点。Ads can be placed at any point in the main video’s time line. 必须告知播放器何时播放广告以及播放哪些广告。You must tell the player when to play the ad and which ads to play. 这使用一组标准的基于 XML 的文件来完成:视频广告服务模板 (VAST)、数字视频多广告播放列表 (VMAP)、媒体抽象排序模板 (MAST) 和数字视频播放器广告接口定义 (VPAID)。This is done using a set of standard XML-based files: Video Ad Service Template (VAST), Digital Video Multiple Ad Playlist (VMAP), Media Abstract Sequencing Template (MAST), and Digital Video Player Ad Interface Definition (VPAID). VAST 文件用于指定要显示哪些广告。VAST files specify what ads to display. VMAP 文件用于指定何时播放各种广告并且包含 VAST XML。VMAP files specify when to play various ads and contain VAST XML. MAST 文件是对包含 VAST XML 的广告进行排序的另一种方法。MAST files are another way to sequence ads which also can contain VAST XML. VPAID 文件用于定义视频播放器与广告或广告服务器之间的接口。VPAID files define an interface between the video player and the ad or ad server. 有关详细信息,请参阅 插入广告For more information, see Inserting Ads.

有关在实时传送视频流视频中隐藏式字幕和广告支持的信息,请参阅 支持的隐藏式字幕和广告插入标准For information about closed captioning and ads support in Live streaming videos, see Supported Closed Captioning and Ad Insertion Standards.

媒体服务学习路径Media Services learning paths

媒体服务 v3(最新版本)Media Services v3 (latest)

查看最新版本的 Azure 媒体服务!Check out the latest version of Azure Media Services!

媒体服务 v2(旧版)Media Services v2 (legacy)

另请参阅See Also

使用 DASH.js 在 HTML5 应用程序中嵌入 MPEG-DASH 自适应流式处理视频Embedding a MPEG-DASH Adaptive Streaming Video in an HTML5 Application with DASH.js

GitHub dash.js 存储库GitHub dash.js repository