Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Added Widevine Base License Acquisition + FairPlay support (#849)
Browse files Browse the repository at this point in the history
* Widevine Base Aquisition Url + FairPlay types

* Added FairPlay support + sample

* Updated readme

* Updated examples readme

* Update .gitignore

* Fixed identation issues

* Fixed identation issues #2

* revert changes to TokenRestrictionTemplateSerializer

* # padding on content key checksum generation is now optional
  • Loading branch information
rnrneverdies authored and yaqiyang committed Aug 8, 2016
1 parent c179d86 commit 6de933f
Show file tree
Hide file tree
Showing 13 changed files with 643 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -43,9 +43,9 @@ Microsoft Azure tables, blobs, queues, service bus (queues and topics), service
* Encoding / process asset, create job, job templates
* Manage media services entities: create / update / read / delete / get list
* Delivery SAS and Streaming media content
* Dynamic encryption: AES and DRM (PlayReady/Widevine) with and without Token restriction
* Dynamic encryption: AES and DRM (PlayReady/Widevine/FairPlay) with and without Token restriction
* Scale encoding reserved unit type
* REST API Version: 2.11
* REST API Version: 2.12


# Getting Started
Expand Down
4 changes: 3 additions & 1 deletion examples/MediaServices/README.md
@@ -1,7 +1,9 @@
This folder contains the following Azure Media Service PHP SDK samples:

* userconfig.php: common file to store the AMS credentials to execute the samples.
* vodworkflow_aes.php: End-to-end VOD workflow that applies AES content protection.
* vodworkflow_aes.php: End-to-end VOD workflow that applies DRM (PlayReady + Widevine) content protection.
* vodworkflow_drm_playready_widevine.php: End-to-end VOD workflow that applies DRM (PlayReady + Widevine) content protection.
* vodworkflow_drm_fairplay.php: End-to-end VOD workflow that applies DRM (FairPlay) content protection.
* scale_encoding_units.php: Scales the encoding reserved units.

To run these samples you can use the following command (assuming that your include_path are correctly configured)
Expand Down
8 changes: 5 additions & 3 deletions examples/MediaServices/vodworkflow_aes.php
Expand Up @@ -45,9 +45,9 @@
use WindowsAzure\MediaServices\Models\AssetDeliveryProtocol;
use WindowsAzure\MediaServices\Models\AssetDeliveryPolicyType;
use WindowsAzure\MediaServices\Models\AssetDeliveryPolicyConfigurationKey;
use WindowsAzure\MediaServices\Templates\SymmetricVerificationKey;
use WindowsAzure\MediaServices\Templates\TokenRestrictionTemplateSerializer;
use WindowsAzure\MediaServices\Templates\TokenRestrictionTemplate;
use WindowsAzure\MediaServices\Templates\SymmetricVerificationKey;
use WindowsAzure\MediaServices\Templates\TokenClaim;
use WindowsAzure\MediaServices\Templates\TokenType;

Expand Down Expand Up @@ -106,7 +106,7 @@ function uploadFileAndCreateAsset($restProxy, $mezzanineFileName)
$asset = $restProxy->createAsset($asset);
$assetId = $asset->getId();

echo 'Asset created: name='.$asset->getName().' id='.$assetId."\r\n";
echo "Asset created: name={$asset->getName()} id={$assetId}\r\n";

// 1.3. create an Access Policy with Write permissions
$accessPolicy = new AccessPolicy('UploadAccessPolicy');
Expand Down Expand Up @@ -284,7 +284,7 @@ function createAssetDeliveryPolicy($restProxy, $encodedAsset, $contentKey)
// 5.2 Generate the AssetDeliveryPolicy Configuration Key
$randomKey = Utilities::generateCryptoKey(16);
$configuration = [AssetDeliveryPolicyConfigurationKey::ENVELOPE_KEY_ACQUISITION_URL => $acquisitionUrl,
AssetDeliveryPolicyConfigurationKey::ENVELOPE_ENCRYPTION_IV_AS_BASE64 => base64_encode($randomKey), ];
AssetDeliveryPolicyConfigurationKey::ENVELOPE_ENCRYPTION_IV_AS_BASE64 => base64_encode($randomKey)];
$confJson = AssetDeliveryPolicyConfigurationKey::stringifyAssetDeliveryPolicyConfiguartionKey($configuration);

// 5.3 Create the AssetDeliveryPolicy
Expand Down Expand Up @@ -369,3 +369,5 @@ function endsWith($haystack, $needle)

return substr($haystack, -$length) === $needle;
}

?>

0 comments on commit 6de933f

Please sign in to comment.