Offline PlayReady Streaming for Windows 10

media services logo


Update your Azure Media Services REST API and SDKs to v3 by 29 February 2024. Version 3 of Azure Media Services REST API and client SDKs for .NET and Java offers more capabilities than version 2. We’re retiring version 2 of the Azure Media Services REST API and client SDKs for .NET and Java.

Action Required: To minimize disruption to your workloads, review the migration guide to transition your code from the version 2 API and SDKs to version 3 API and SDK before February 29th, 2024. After February 29th, 2024, Azure Media Services will no longer accept traffic on the version 2 REST API, the ARM account management API version 2015-10-01, or from the version 2 .NET client SDKs. This includes any 3rd party open-source client SDKS that may call the version 2 API. Learn about the latest version, starting with the Media Services v3 Overview.

Azure Media Services support offline download/playback with DRM protection. This article covers offline support of Azure Media Services for Windows 10/PlayReady clients. You can read about the offline mode support for iOS/FairPlay and Android/Widevine devices in the following articles:


This section gives some background on offline mode playback, especially why:

  • In some countries/regions, Internet availability and/or bandwidth is still limited. Users may choose to download first to be able to watch content in high enough resolution for satisfactory viewing experience. In this case, more often, the issue is not network availability, rather it is limited network bandwidth. OTT/OVP providers are asking for offline mode support.
  • As disclosed at Netflix 2016 Q3 shareholder conference, downloading content is a “oft-requested feature”, and “we are open to it” said by Reed Hastings, Netflix CEO.
  • Some content providers may disallow DRM license delivery beyond a country/region's border. If a user needs to travel abroad and still wants to watch content, offline download is needed.

The challenge we face in implementing offline mode is the following:

  • MP4 is supported by many players, encoder tools, but there is no binding between MP4 container and DRM;
  • In the long term, CFF with CENC is the way to go. However, today, the tools/player support ecosystem is not there yet. We need a solution, today.

The idea is: smooth streaming (PIFF) file format with H264/AAC has a binding with PlayReady (AES-128 CTR). Individual smooth streaming .ismv file (assuming audio is muxed in video) is itself a fMP4 and can be used for playback. If a smooth streaming content goes through PlayReady encryption, each .ismv file becomes a PlayReady protected fragmented MP4. We can choose an .ismv file with the preferred bitrate and rename it as .mp4 for download.

There are two options for hosting the PlayReady protected MP4 for progressive download:

  • One can put this MP4 in the same container/media service asset and leverage Azure Media Services streaming endpoint for progressive download;
  • One can use SAS locator for progressive download directly from Azure Storage, bypassing Azure Media Services.

You can use two types of PlayReady license delivery:

  • PlayReady license delivery service in Azure Media Services;
  • PlayReady license servers hosted anywhere.

Below are two sets of test assets, the first one using PlayReady license delivery in AMS while the second one using my PlayReady license server hosted on an Azure VM:

Asset #1:

Asset #2:

For playback testing, I used a Universal Windows Application on Windows 10. In Windows 10 Universal samples, there is a basic player sample called Adaptive Streaming Sample. All we have to do is to add the code for us to pick downloaded video and use it as the source, instead of adaptive streaming source. The changes are in button click event handler:

private async void LoadUri_Click(object sender, RoutedEventArgs e)
    //Uri uri;
    //if (!Uri.TryCreate(UriBox.Text, UriKind.Absolute, out uri))
    // Log("Malformed Uri in Load text box.");
    // return;
    //LoadSourceFromUriTask = LoadSourceFromUriAsync(uri);
    //await LoadSourceFromUriTask;

    //willzhan change start
    // Create and open the file picker
    FileOpenPicker openPicker = new FileOpenPicker();
    openPicker.ViewMode = PickerViewMode.Thumbnail;
    openPicker.SuggestedStartLocation = PickerLocationId.ComputerFolder;

    StorageFile file = await openPicker.PickSingleFileAsync();

    if (file != null)
       //rootPage.NotifyUser("Picked video: " + file.Name, NotifyType.StatusMessage);
       this.mediaPlayerElement.MediaPlayer.Source = MediaSource.CreateFromStorageFile(file);
       UriBox.Text = file.Path;
       // rootPage.NotifyUser("Operation cancelled.", NotifyType.ErrorMessage);

    // On small screens, hide the description text to make room for the video.
    DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;

Offline mode playback of PlayReady protected fMP4

Since the video is under PlayReady protection, the screenshot will not be able to include the video.

In summary, we have achieved offline mode on Azure Media Services:

  • Content transcoding and PlayReady encryption can be done in Azure Media Services or other tools;
  • Content can be hosted in Azure Media Services or Azure Storage for progressive download;
  • PlayReady license delivery can be from Azure Media Services or elsewhere;
  • The prepared smooth streaming content can still be used for online streaming via DASH or smooth with PlayReady as the DRM.

Additional notes

  • Widevine is a service provided by Google Inc. and subject to the terms of service and Privacy Policy of Google, Inc.