Skip to content

Commit

Permalink
test: Fix MSS VoD PlayReady test (#6596)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed May 14, 2024
1 parent 1429763 commit d168896
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/mss/mss_player_integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
describe('MSS Player', () => {
const Util = shaka.test.Util;

/** @type {!Object.<string, ?shaka.extern.DrmSupportType>} */
let support = {};

/** @type {!jasmine.Spy} */
let onErrorSpy;

Expand All @@ -31,11 +34,20 @@ describe('MSS Player', () => {
// eslint-disable-next-line max-len
const playreadyLicenseUrl = 'https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)';

function checkPlayReadySupport() {
const playReadySupport = support['com.microsoft.playready'];
if (!playReadySupport) {
return false;
}
return playReadySupport.encryptionSchemes.includes('cenc');
}

beforeAll(async () => {
video = shaka.test.UiUtils.createVideoElement();
document.body.appendChild(video);
compiledShaka =
await shaka.test.Loader.loadShaka(getClientArg('uncompiled'));
support = await shaka.media.DrmEngine.probeSupport();
});

beforeEach(async () => {
Expand Down Expand Up @@ -92,9 +104,8 @@ describe('MSS Player', () => {
await player.unload();
});

it('MSS VoD PlayReady', async () => {
const support = await shaka.media.DrmEngine.probeSupport();
if (!support['com.microsoft.playready']) {
drmIt('MSS VoD PlayReady', async () => {
if (!checkPlayReadySupport()) {
pending('PlayReady is not supported by the platform.');
}

Expand Down

0 comments on commit d168896

Please sign in to comment.