"Unable to decrypt the encrypted video source (0x20500006)"

Gitesh Mangla 6 Reputation points
2021-08-09T05:04:38.52+00:00

Hello,
My name is Gitesh,

I'm currently developping a website to stream video's in Asp .Net 5(c#).
Azure Media Services is my chosen platform to host the video's from.
Azure Media Player is the player I use on the website to render the video's.

I have got the playback of unprotected videos running, but I'm struggeling to get the playback of a DRM encoded video running. Via the Azure Media Services Explorer tool I have configured DRM on one particular asset.

When I playback the video via the Azure Media Services Explorer tool with the Azure Media Player, Its working fine with Bearer token.But when I try to playback the video from my website(I am sending Bearer Token as authToken on FrontEnd.), it is diplaying "Unable to decrypt the encrypted video source (0x20500006)". I see in chrome developer tools (console window) then getting below error.
Failed to load resource: the server responded with a status of 401 (Unauthorized).

Azure Media Services
Azure Media Services
A group of Azure services that includes encoding, format conversion, on-demand streaming, content protection, and live streaming services.
302 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. William Zhang 1 Reputation point
    2021-08-09T18:55:36.673+00:00

    Can you share an auth token you used as bearer token by your player (outside of AMSE)? Which service issued the token?

    AMSE issues symmetric token with a static encryption key, while most token issuers issue tokens with asymmetric key. Let's start from the token issued and token claims.


  2. Gitesh Mangla 1 Reputation point
    2022-09-29T12:46:08.457+00:00

    Hi Sanjay,

    Sorry for the late response

    I have resolved the above issue by using the below code. Below code is working for both (Window and MAC)

    <video id="resourceVideoTag"
    class="azuremediaplayer amp-default-skin amp-big-play-centered video-upload-box vid2"
    controls
    width="640"
    height="400"
    poster="@默 .ResourceVideo.ThumbNailUrl"
    data-setup='{
    "controls": true, "autoplay": false ,
    "logo": { "enabled": false },
    "techOrder": ["azureHtml5JS", "flashSS", "html5FairPlayHLS","silverlightSS", "html5"],
    "nativeControlsForTouch": false
    }'
    tabindex="0">
    <source src="@默 .ResourceVideo.VideoUrl"
    data-setup='{
    "protectionInfo": [{"type": "PlayReady", "authenticationToken": "@默 .ResourceVideo.BearerToken"},
    {"type": "Widevine", "authenticationToken": "@默 .ResourceVideo.BearerToken"},
    {"type":"FairPlay","certificateUrl" :"@默 .CertificateFilePath","authenticationToken": "@默 .ResourceVideo.BearerTokenFairPlay"}] ,
    "techOrder": ["azureHtml5JS", "flashSS", "html5FairPlayHLS","silverlightSS", "html5"]
    }'
    type="application/vnd.ms-sstr+xml" />
    <p class="amp-no-js">
    To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
    </p>
    </video>

    Jquery Code

    var myResourcePlayer = amp('resourceVideoTag');
    amp('resourceVideoTag').ready(function () {
    myResourcePlayer = this;
    myResourcePlayer.play();
    });