Developing Video Player Applications
Updated: July 8, 2014
Azure Media Services supports many popular streaming formats, such as Smooth Streaming, HTTP Live Streaming, and MPEG-Dash. This topic points you to existing players that you can use to test your streams. The 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 Media Services.
Currently, you can only insert ads on the client side. For more information, see Advertising.
See Delivering Content for information on how to delivery content to your clients in any of the following formats: MPEG DASH, Apple HLS, HDS, or Smooth Streaming.
Also, see how to protect your content with AES or PlayReady: Using PlayReady Dynamic Encryption and License Delivery Service, Using AES-128 Dynamic Encryption and Key Delivery Service.
You can use the Azure Management Portal’s MEDIA SERVICES CONTENT PLAYER located on the CONTENT page to test your published content.
If you want to play content that was encoded to adaptive bitrate, make sure to get at least one streaming unit for the streaming endpoint from which you plan to deliver your content. For information on how to scale Media Services, see How to scale a Media Service.
|Note that the MEDIA SERVICES CONTENT PLAYER plays from the default streaming endpoint. If you want to play from a non-default streaming endpoint, use another player. For example, http://amsplayer.azurewebsites.net/|
The best way to test HLS streams is to use iOS or Android devices.
However, sometimes you need to test on Windows. In this case you can use 3ivx-hls-player or Flesh OSMF players. Both players can play HLS encrypted with AES-128. However, both players will only work if you set the key authorization policy to open.
For information on how to protect HLS with AES and how to configure content key’s authorization policy, see Using AES-128 Dynamic Encryption and Key Delivery Service.
To test Smooth Streaming, use smf.cloudapp.net/healthmonitor.
You can use the same player to test Smooth Streaming protected with PlayReady DRM. However, it will only work if the key authorization policy is set to open.
To test Smooth Streaming protected with PlayReady and the key authorization policy set to token restriction, use http://sltoken.azurewebsites.net/.
You can find the code for the player here: SilverlightPlayerForAMSPlayReadyTokenAuth. Also, see the blog that describes the code: Using a Silverlight player with PlayReady and Token Authentication.
You can also use a plugin for the OSMF player, see: Microsoft Adaptive Streaming Plugin for OSMF Update.
For information on how to protect your content with PlayReady and how to configure content key’s authorization policy, see Using PlayReady Dynamic Encryption and License Delivery Service.
This section provides an overview of different player frameworks that you can use to develop for:
Most browsers only support progressive download with the HTML5 video element. Safari on iOS and Macintosh OS support HTTP Live Streaming (HLS). To enable you to support browser-based streaming support Microsoft provides the following:
Smooth Streaming Client SDK
Microsoft Media Platform: Player Framework
HTML5 Player Framework
OSMF Smooth Streaming Plugin for Flash
The Smooth Streaming Client SDK provides an easy-to-use interface for developers and designers to create rich Smooth Streaming experiences using the Microsoft Silverlight platform. The SDK is composed of .NET Framework-based APIs that provide support for simple operations such as play, pause, and stop and also for more complex operations such as scheduling advertisements, selecting and tracking bitrates for Smooth Streaming playback, and many more. Examples of available client-side features include simple controls such as Play, Pause, and Stop, as well as more complex functionality such as full DVR, Instant Replay, Live Ad Insertion, Multiple Camera Angles, and Seek (Fast Forward/Rewind) capabilities.
Smooth Streaming Client SDK for Windows Phone 8.1 enables developers to build Windows Phone 8.1 store applications that consume On-demand and Live Smooth Streaming content with PlayReady protection.
The Smooth Streaming Client SDK is a core component of the broader open source Microsoft Media Platform: Player Framework (MMPPF). For most scenarios, the MMPPF is the simplest, most robust way to build a new Silverlight player that supports the full set of Smooth Streaming functions. The Smooth Streaming Client SDK can be ideal for some scenarios, however, such as adding rich Smooth Streaming features to a Silverlight media player based on a different framework, or where unique scenarios can't otherwise be addressed.
To get started quickly, a Smooth Streaming Sample Player is included with each release of the MMPPF. (See the MMPPF Project on Codeplex.) This contains a pre-built player that supports Smooth Streaming. To play your content simply edit a configuration file - no need to compile. Quick-start documentation about how to build your own player for multiple endpoints, including Windows Phone, is available on the MMPPF Documentation page. For more Windows Phone development information, see the Windows Phone Dev Center.
The HTML5 Player Framework is intended for use in browser-based applications. The framework has been tested in the latest versions of both desktop and mobile browsers that support the HTML5 video tag. It should be noted that the W3C does not currently have a standard for adaptive bitrate streaming so most browsers only support simple progressive download playback at this time. Microsoft, along with ninety other technology and media companies, is driving a standard called MPEG DASH that promises to become the industry-wide standard for adaptive streaming in the future. We expect MPEG DASH to be supported in browsers, devices, and various application platforms. Once it has been implemented we will update the HTML5 player framework to support this standard. For more information, see HTML5 Player Framework on CodePlex.
The Smooth Streaming plugin for Open Source Media Framework 2.0(OSMF) enables you to build applications in OSMF or Strobe Media Playback (SMP) that consume Smooth Streaming content. Developers can easily add Smooth Streaming playback capabilities to existing OSMF-based players as well as dynamically load the plugin for use with Strobe Media Playback and enable their existing or new applications to consume Smooth Streaming with very little to no code changes.
Microsoft provides two frameworks for delivery of adaptive streaming content to iOS devices: iOS Azure Media Player Framework and iOS SDK for Smooth Streaming with PlayReady.
The Azure Media Services iOS Media Player Framework library makes it easy for iPod, iPhone, and iPad developers to create rich, dynamic client applications that create and mix video and audio streams together on the fly. For example, applications that display sports content can easily insert advertisements wherever they choose and control how often those advertisements appear even when the main content is rewound. Educational applications can use the same functionality, for example, to create content in which the main lectures have asides, or sidebars, before returning to the main content. The SDK contains a sample player application that demonstrates how to build an iOS application that uses most of these features to create a content stream on the fly as well as enable the user to trigger an insert dynamically by pushing a button. For more information, see iOS Media Player Framework on GitHub.
The iOS SDK for Smooth Streaming is a library the enables iOS developers to build premium Smooth Streaming client applications for the iPad and iPhone platforms. It enables you to develop player applications that can playback Smooth Streaming content protected with PlayReady DRM. It includes support for multiple audio languages, stream and track selection. The iOS SDK also allows you to create applications that consume Apple HLS content. To use this SDK you must purchase a license. For more information email email@example.com.
You can develop player applications for Android devices using the OSMF Plug-in for Flash, or the Microsoft Smooth Streaming Client Porting Kit (SSPK) described in the next section.
For writing client player applications on Windows there are two choices: Smooth Streaming Client SDK and Microsoft Media Platform: Player Framework for Windows 8 Applications.
The Smooth Streaming Client SDK for Windows 8 enables development of Smooth Streaming Windows Store applications. You can use the Microsoft Media Platform Player Framework and Smooth Streaming Client SDK to build rich media experiences on Windows 8 using the same back-end infrastructure you use for Smooth Streaming applications for the browser, set-top boxes, Windows Phone, and other mobile devices. For more information, see Smooth Streaming Client SDK. For an example of how to build a Smooth Streaming Windows Store Application, see How to Build a Smooth Streaming Windows Store Application.
Adaptive streaming and advanced playback heuristics
Closed captioning support via SMPTE-TT and TTML
Advanced DVR-style playback
Robust skinning and styling
For more information, see Player Framework for Windows 8 on CodePlex.
For writing Windows Phone Client applications Microsoft provides the following:
Smooth Streaming Client SDK for Windows Phone
Microsoft Media Platform: Player Framework for Windows Phone
The Smooth Streaming Client SDK for Windows Phone enables development of Smooth Streaming Windows Phone applications. For more information, see Smooth Streaming Client SDK. Quick-start documentation about how to build your own player for multiple endpoints, including Windows Phone, is available on the MMPPF Documentation page. For more Windows Phone development information, see the Windows Phone Dev Center.
The Player Framework for Windows Phone is based on the Microsoft Media Platform: Player Framework for Windows 8 Applications but designed exclusively for Windows Phone 8 applications. It includes support for advertising, localization, and player skinning. This SDK is not backward-compatible with Windows Phone 7. You can download MMP Player Framework 2.7 on CodePlex if you need to target Windows Phone 7 devices. You can download the Player Framework for Windows Phone 8 on Codeplex.
For developing XBox applications Microsoft offers an Application Development Kit (ADK) that includes an XBox SDK and framework. These enable you to write XBox client applications that can consume Smooth Streaming content with PlayReady DRM. Additionally you can monetize your applications with built-in ad support and rich analytics. To download the ADK you must join the XBox Registered Developers Program. For more information about developing XBox applications, see XBox Developers Program.
To develop player applications for other devices, you must purchase a license for the Smooth Streaming Client Porting Kit. Microsoft Smooth Streaming Client Porting Kit (SSPK) is a Smooth Streaming client implementation optimized to help embedded device manufacturers, cable and mobile operators, content service providers, handset manufacturers, independent software vendors (ISVs), and solution providers create products and services for streaming adaptive streaming content in Smooth Streaming format. SSPK is a device and platform independent implementation of Smooth Streaming client that can be ported by the licensee to any device and platform. For more information, see Licensing Microsoft Smooth Streaming Client Porting Kit.
Azure Media Services provides support for ad insertion through the Windows Media Platform: Player Frameworks. 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. 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 files specify what ads to display. VMAP files specify when to play various ads and contain VAST XML. MAST files are another way to sequence ads which also can contain VAST XML. VPAID files define an interface between the video player and the ad or ad server. For more information, see Inserting Ads.