Skip to content

Commit

Permalink
feat(HLS): Add support for getting license server url for PlayReady (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Dec 20, 2024
1 parent 1f3af8b commit effa244
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ goog.require('goog.Uri');
goog.require('goog.asserts');
goog.require('shaka.abr.Ewma');
goog.require('shaka.drm.DrmUtils');
goog.require('shaka.drm.PlayReady');
goog.require('shaka.hls.Attribute');
goog.require('shaka.hls.ManifestTextParser');
goog.require('shaka.hls.Playlist');
Expand All @@ -24,6 +25,7 @@ goog.require('shaka.media.PresentationTimeline');
goog.require('shaka.media.QualityObserver');
goog.require('shaka.media.SegmentIndex');
goog.require('shaka.media.SegmentReference');
goog.require('shaka.media.SegmentUtils');
goog.require('shaka.net.DataUriPlugin');
goog.require('shaka.net.NetworkingEngine');
goog.require('shaka.net.NetworkingEngine.PendingRequest');
Expand All @@ -39,7 +41,6 @@ goog.require('shaka.util.MimeUtils');
goog.require('shaka.util.Networking');
goog.require('shaka.util.OperationManager');
goog.require('shaka.util.Pssh');
goog.require('shaka.media.SegmentUtils');
goog.require('shaka.util.Timer');
goog.require('shaka.util.TsParser');
goog.require('shaka.util.TXml');
Expand Down Expand Up @@ -4863,6 +4864,15 @@ shaka.hls.HlsParser = class {
{initDataType: 'cenc', initData: pssh},
]);

const input = shaka.util.TXml.parseXmlString([
'<PLAYREADY>',
shaka.util.Uint8ArrayUtils.toBase64(data),
'</PLAYREADY>',
].join('\n'));
if (input) {
drmInfo.licenseServerUri = shaka.drm.PlayReady.getLicenseUrl(input);
}

return drmInfo;
}

Expand Down

0 comments on commit effa244

Please sign in to comment.