Widevine encrypted videos in Azure do not expire

270 Views Asked by At

I am trying to enable my Azure-hosted video for offline viewing in Chrome with a "rental period" so that it expires after a few days. I started with the OfflinePlayReadyAndWidevine java example project. I updated this method to specify 30 seconds for all three durations.

    policyOverrides.setRentalDurationSeconds(30);
    policyOverrides.setPlaybackDurationSeconds(30);
    policyOverrides.setLicenseDurationSeconds(30);

That seemed to work. Looking at the Asset Information inside Azure Media Services Explorer, I see in the Content Protection tab these 30 second durations show up:

  "properties.options": [
    {
      "policyOptionId": "1d9620f2-bc02-4ddc-a64f-b25e5f02b6e5",
      "name": null,
      "configuration": {
        "widevineTemplate": "{\"AllowedTrackTypes\":\"SD_HD\",\"ContentKeySpecs\":[{\"TrackType\":\"SD\",\"SecurityLevel\":1,\"RequiredOutputProtection\":{\"HDCP\":\"HDCP_NONE\"}}],\"PolicyOverrides\":{\"CanPlay\":true,\"CanPersist\":true,\"CanRenew\":false,\"RentalDurationSeconds\":30,\"PlaybackDurationSeconds\":30,\"LicenseDurationSeconds\":30}}"
      },
      "restriction": {}
    }
  ],

But it doesn't seem to take effect. In Chrome on Windows, I add my URL to the Shaka player with its Custom Content section, clicked the download button, unplugged the internet, and I am able to play the video over and over. It does not seem to expire. I also do not experience expiration in the Azure media player, although I'm focused on getting Shaka to work first because of its offline support.

If someone has tested this to work before, I'd be very interested to see how!

1

There are 1 best solutions below

1
On BEST ANSWER

In your Widevine template, the 3 attribute names:

  1. RentalDurationSeconds
  2. PlaybackDurationSeconds
  3. LicenseDurationSeconds

look different from the corresponding 3 attribute names in Widevine proxy spec or in Azure Media Services doc on Widevine template (https://learn.microsoft.com/en-us/azure/media-services/previous/media-services-widevine-license-template-overview)

They should be, respectively

  1. rental_duration_seconds
  2. playback_duration_seconds
  3. license_duration_seconds

This way it would be consistent with Widevine proxy doc or AMS doc above.

For the time being, could you set the Widevine template as a JSON string instead of thru property setters?